interface AuthenticationProviderInterface (View source)

Contract for an authentication provider used by the AuthenticationProviderManager.

Has to add a TokenInterface to the security context, which contains.

Methods

create(string $name, array $options)

Constructs an instance with the given name and options.

bool
canAuthenticate(TokenInterface $token)

Returns true if the given token can be authenticated by this provider

array
getTokenClassNames()

Returns the classnames of the tokens this provider is responsible for.

void
authenticate(TokenInterface $authenticationToken)

Tries to authenticate the given token. Sets isAuthenticated to true if authentication succeeded.

Details

static AuthenticationProviderInterface create(string $name, array $options)

Constructs an instance with the given name and options.

Parameters

string $name
array $options

Return Value

AuthenticationProviderInterface

bool canAuthenticate(TokenInterface $token)

Returns true if the given token can be authenticated by this provider

Parameters

TokenInterface $token

The token that should be authenticated

Return Value

bool

true if the given token class can be authenticated by this provider

array getTokenClassNames()

Returns the classnames of the tokens this provider is responsible for.

Return Value

array

The classname of the token this provider is responsible for

void authenticate(TokenInterface $authenticationToken)

Tries to authenticate the given token. Sets isAuthenticated to true if authentication succeeded.

Parameters

TokenInterface $authenticationToken

The token to be authenticated

Return Value

void