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

Conversation

DaumantasUrb
Copy link

Make the test curl http://localhost:8000/ return this value:
{"message":"Authentication Required"}
instead of
{"message":"Username could not be found."}

Make the test curl http://localhost:8000/ return this value:
{"message":"Authentication Required"}
instead of
{"message":"Username could not be found."}
Remove anonymous authentication to force digest authentication
@xabbuh
Copy link
Member

xabbuh commented Jun 4, 2017

Hm, we recently made this change (see #7065).

@DaumantasUrb
Copy link
Author

hmm sorry about that, first pull request, I can only see it being corrected in 3.1 and not the above versions

@@ -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?

@HeahDude HeahDude added this to the 2.8 milestone Jul 29, 2017
@javiereguiluz
Copy link
Member

I'm closing because we recently closed another similar pull request that also returned null instead of throwing the exception, which apparently is wrong in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants