8000 Update guard_authentication.rst by ThomasLandauer · Pull Request #13393 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Update guard_authentication.rst #13393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update guard_authentication.rst
  • Loading branch information
ThomasLandauer authored and javiereguiluz committed Mar 23, 2020
commit 4fcc154f0f3cb229d00c8d4edf13783fa160157e
7 changes: 4 additions & 3 deletions security/guard_authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ This requires you to implement several methods::
{
/**
* Called on every request to decide if this authenticator should be
* used for the request. Returning false will cause this authenticator
* used for the request. Returning `false` will cause this authenticator
* to be skipped.
*/
public function supports(Request $request)
Expand All @@ -194,7 +194,8 @@ This requires you to implement several methods::
public function getUser($credentials, UserProviderInterface $userProvider)
{
if (null === $credentials) {
// The token header was empty, authentication fails with 401
// The token header was empty, authentication fails with HTTP Status
// Code 401 "Unauthorized"
return null;
}

Expand All @@ -220,7 +221,7 @@ This requires you to implement several methods::
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
$data = [
// you may ant to customize or obfuscate the message first
// you may want to customize or obfuscate the message first
'message' => strtr($exception->getMessageKey(), $exception->getMessageData())

// or to translate this message
Expand Down
0