Last updated on
9 January 2017
The Authentication API is new in Drupal 8.
Ordered by most to least frequently used APIs:
- Authentication provider services
\Drupal\Core\Authentication\AuthenticationProviderInterfaceand use the
_authoption on routes
- The default authentication manager (see below) enables developers to limit the set of allowed authentication mechanisms to the specified subset by specifying
_authin a route's
_auth: ['basic_auth', 'cookie']
- Authentication manager
- The authentication manager (
\Drupal\Core\Authentication\AuthenticationManager) calls the different authentication provider services based on each service's priority.
- The manager can be overridden for very advanced use cases; 99.9% of the time the default implementation should be sufficient.