interface AuthenticationProviderChallengeInterface (View source)

Generate a challenge when access is denied for unauthenticated users.

On a 403 (access denied), if there are no credentials on the request, some authentication methods (e.g. basic auth) require that a challenge is sent to the client.

Methods

HttpExceptionInterface|null
challengeException(Request $request, Exception $previous)

Constructs an exception which is used to generate the challenge.

Details

HttpExceptionInterface|null challengeException(Request $request, Exception $previous)

Constructs an exception which is used to generate the challenge.

Parameters

Request $request

The request.

Exception $previous

The previous exception.

Return Value

HttpExceptionInterface|null

An exception to be used in order to generate an authentication challenge.