-
Notifications
You must be signed in to change notification settings - Fork 259
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
According to https://tools.ietf.org/html/rfc6749#section-2.3.1 client… #534
Conversation
… identifier and secret MUST be x-www-form-urlencoded when doing client_secret_basic client authentication.
src/oic/utils/authn/client.py
Outdated
@@ -108,7 +109,7 @@ def construct(self, cis, request_args=None, http_args=None, **kwargs): | |||
if "headers" not in http_args: | |||
http_args["headers"] = {} | |||
|
|||
credentials = "{}:{}".format(user, passwd) | |||
credentials = "{}:{}".format(quote_plus(user), quote_plus(passwd)) | |||
authz = base64.urlsafe_b64encode(credentials.encode("utf-8")).decode( |
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.
To think of it, shouldn't content be just b64encode
d instead of urlsafe_b64encode
d?
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.
Hmm, you may well be right!
tests/test_client.py
Outdated
assert http_args == {"headers": {"Authorization": "Basic {}".format( | ||
base64.urlsafe_b64encode("A:boarding pass".encode("utf-8")).decode( | ||
"utf-8"))}} | ||
base64.urlsafe_b64encode(cred.encode("utf-8")).decode("utf-8"))}} |
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.
same, shouldn't basic auth use just b64encode
?
tests/test_authn_user.py
Outdated
credentials = "{}:{}".format(quote_plus(user), | ||
quote_plus(passwd)) | ||
|
||
authz = base64.urlsafe_b64encode(credentials.encode("utf-8")).decode( |
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.
same, shouldn't basic auth use just b64encode
?
Codecov Report
@@ Coverage Diff @@
## master #534 +/- ##
==========================================
+ Coverage 59.54% 59.61% +0.07%
==========================================
Files 62 62
Lines 11237 11247 +10
Branches 1978 1981 +3
==========================================
+ Hits 6691 6705 +14
+ Misses 3992 3984 -8
- Partials 554 558 +4
Continue to review full report at Codecov.
|
Changelog entry is still missing, looks good otherwise. |
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.
LGTM
… identifier and secret MUST be x-www-form-urlencoded when doing client_secret_basic client authentication.
CHANGELOG.md
.