AuthenticationService
class AuthenticationService implements AuthenticationServiceInterface
Service used to authenticate users between Microsoft 365 and Drupal.
Traits
Properties
| protected AuthmapInterface | $authmap | The auth map. |
|
| protected ConfigFactoryInterface | $configFactory | The config factory interface. |
|
| protected ConstantsService | $constants | The ConstantsService implementation. |
|
| protected AccountProxyInterface | $currentUser | The current user account. |
|
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected HelperService | $helperService | The o365 helper service. |
|
| protected O365LoggerServiceInterface | $loggerService | The logger service. |
|
| protected Messenger | $messenger | The messenger. |
|
| protected ImmutableConfig | $moduleConfig | The modules base config. |
|
| protected GenericProvider | $oauthClient | An oauth provider. |
|
| protected Request | $request | The current request. |
|
| protected ImmutableConfig | $ssoConfig | The o365_sso config. |
|
| protected PrivateTempStoreFactory | $tempStore | The private temp store. |
Methods
Constructs a new AuthenticationService object.
Check if a user is logged in via Office.
Get the access token for the user.
Get data from the temp store.
Redirect the user to the correct Microsoft pages for OAuth2.
Save the auth data from the url parameters in the user session storage.
Generate and save the access token.
Details
at line 130
__construct(ConfigFactoryInterface $configFactory, PrivateTempStoreFactory $tempStoreFactory, ConstantsService $constantsService, O365LoggerServiceInterface $loggerService, RequestStack $requestStack, HelperService $helperService, AccountProxyInterface $accountProxy, AuthmapInterface $authmap, Messenger $messenger, EntityTypeManagerInterface $entityTypeManager)
Constructs a new AuthenticationService object.
at line 275
string|bool
checkForOfficeLogin()
Check if a user is logged in via Office.
at line 230
string|false
getAccessToken(bool $login = TRUE)
Get the access token for the user.
at line 406
mixed
getDataFromTempStore(string $name)
Get data from the temp store.
at line 150
mixed
redirectToAuthorizationUrl(O365ConnectorInterface $o365_connector)
Redirect the user to the correct Microsoft pages for OAuth2.
at line 261
void
saveAuthDataFromUrl()
Save the auth data from the url parameters in the user session storage.
at line 197
setAccessToken(string $code, O365ConnectorInterface $o365_connector, string $redirect = '')
Generate and save the access token.