interface AuthenticationProviderChallengeInterface

Same name in other branches
  1. 9 core/lib/Drupal/Core/Authentication/AuthenticationProviderChallengeInterface.php \Drupal\Core\Authentication\AuthenticationProviderChallengeInterface
  2. 8.9.x core/lib/Drupal/Core/Authentication/AuthenticationProviderChallengeInterface.php \Drupal\Core\Authentication\AuthenticationProviderChallengeInterface
  3. 11.x core/lib/Drupal/Core/Authentication/AuthenticationProviderChallengeInterface.php \Drupal\Core\Authentication\AuthenticationProviderChallengeInterface

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.

Hierarchy

Expanded class hierarchy of AuthenticationProviderChallengeInterface

All classes that implement AuthenticationProviderChallengeInterface

2 files declare their use of AuthenticationProviderChallengeInterface
AuthenticationSubscriber.php in core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php
BasicAuth.php in core/modules/basic_auth/src/Authentication/Provider/BasicAuth.php

File

core/lib/Drupal/Core/Authentication/AuthenticationProviderChallengeInterface.php, line 14

Namespace

Drupal\Core\Authentication
View source
interface AuthenticationProviderChallengeInterface {
    
    /**
     * Constructs an exception which is used to generate the challenge.
     *
     * @param \Symfony\Component\HttpFoundation\Request $request
     *   The request.
     * @param \Exception $previous
     *   The previous exception.
     *
     * @return \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface|null
     *   An exception to be used in order to generate an authentication challenge.
     */
    public function challengeException(Request $request, \Exception $previous);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
AuthenticationProviderChallengeInterface::challengeException public function Constructs an exception which is used to generate the challenge. 2

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.