Skip to content

Update AbstractGuardAuthenticator implementation code to pass curl test according to documentation #7996

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

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 3 additions & 3 deletions security/guard_authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ This requires you to implement seven methods::
public function getCredentials(Request $request)
{
if (!$token = $request->headers->get('X-AUTH-TOKEN')) {
// No token?
$token = null;
// No token? Return null and show "Authentication Required"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @DaumantasUrb, thank you for this first contribution.
Sadly this change is wrong, another guard can still authenticate this request is this one returning null. If one want to get the exception at this point an exception should be thrown.

Should you we improve the docs so this is better explained?

return null;
}

// What you return here will be passed to getUser() as $credentials
Expand Down Expand Up @@ -264,7 +264,7 @@ Finally, configure your ``firewalls`` key in ``security.yml`` to use this authen
# ...

main:
anonymous: ~
# remove anonymous authentication to force digest authentication
logout: ~

guard:
Expand Down