AuthenticationProviderChallengeInterface.php 886 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Drupal\Core\Authentication;
  3. use Symfony\Component\HttpFoundation\Request;
  4. /**
  5. * Generate a challenge when access is denied for unauthenticated users.
  6. *
  7. * On a 403 (access denied), if there are no credentials on the request, some
  8. * authentication methods (e.g. basic auth) require that a challenge is sent to
  9. * the client.
  10. */
  11. interface AuthenticationProviderChallengeInterface {
  12. /**
  13. * Constructs an exception which is used to generate the challenge.
  14. *
  15. * @param \Symfony\Component\HttpFoundation\Request $request
  16. * The request.
  17. * @param \Exception $previous
  18. * The previous exception.
  19. *
  20. * @return \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface|null
  21. * An exception to be used in order to generate an authentication challenge.
  22. */
  23. public function challengeException(Request $request, \Exception $previous);
  24. }