class UserLoginController extends ControllerBase

UserLoginController. Used when returned from the callback.

This creates/updates the user and logs in the Drupal user.

Properties

protected AuthenticationService $authenticationService

Drupal\o365\AuthenticationService definition.

protected ExternalAuth $externalAuth

The external auth service.

protected GraphService $graphService

Drupal\o365\GraphService definition.

Methods

__construct(GraphService $o365_graph, AuthenticationService $authenticationService, EntityTypeManagerInterface $entity_type_manager, ExternalAuth $externalAuth)

Constructs a new UserLoginController object.

static 
create(ContainerInterface $container)

{@inheritdoc}

RedirectResponse
login(O365ConnectorInterface $o365_connector)

Login a user.

string
sanitizeUsername(string $username)

Sanitize username.

Details

at line 55
__construct(GraphService $o365_graph, AuthenticationService $authenticationService, EntityTypeManagerInterface $entity_type_manager, ExternalAuth $externalAuth)

Constructs a new UserLoginController object.

Parameters

GraphService $o365_graph

The GraphService definition.

AuthenticationService $authenticationService

The AuthenticationService definition.

EntityTypeManagerInterface $entity_type_manager

The EntityTypeManager definition.

ExternalAuth $externalAuth

The ExternalAuth definition.

at line 65
static create(ContainerInterface $container)

{@inheritdoc}

Parameters

ContainerInterface $container

at line 85
RedirectResponse login(O365ConnectorInterface $o365_connector)

Login a user.

Parameters

O365ConnectorInterface $o365_connector

The o365 connector interface.

Return Value

RedirectResponse

The redirect to the set URL in config.

Exceptions

InvalidPluginDefinitionException
PluginNotFoundException
TempStoreException
GuzzleException
GraphException

at line 188
string sanitizeUsername(string $username)

Sanitize username.

Parameters

string $username

The username coming from o365.

Return Value

string

The sanitized username.