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
[bug] unexpected freeradius authorize failed #150
Conversation
@@ -191,7 +191,7 @@ def get_user(self, request): | |||
# ensure user is member of the authenticated org | |||
# or RadiusToken for the user exists. | |||
if ( | |||
RadiusToken.objects.filter(user=user, can_auth=True).exists() | |||
RadiusToken.objects.filter(user=user).exists() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can_auth
is removed here:
Send auth with "username=admin&password=admin"
Success
Send auth with "username=admin&password=radtoken"
Success
Send auth with "username=admin&password=admin"
Failed Unexpectedly
Why? Because can_auth=True
is false now!
Fix: remove can_auth
from get_user()
and only keep it in check_user_token()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add a test for this bug? Should be quick.
@@ -191,7 +191,7 @@ def get_user(self, request): | |||
# ensure user is member of the authenticated org | |||
# or RadiusToken for the user exists. | |||
if ( | |||
RadiusToken.objects.filter(user=user, can_auth=True).exists() | |||
RadiusToken.objects.filter(user=user).exists() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add a test for this bug? Should be quick.
c0ae381
to
2dbba63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this PR needs to be rebased to fix the failing build.
2dbba63
to
28254c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.