Skip to content
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

Improvement in extract authorization token #28

Closed
nggary opened this issue Feb 13, 2018 · 1 comment
Closed

Improvement in extract authorization token #28

nggary opened this issue Feb 13, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@nggary
Copy link

nggary commented Feb 13, 2018

In urls.py

def extract_basic_authorization(token):
    """Extract token from Basic Authorization."""
    query = to_unicode(base64.b64decode(token))
    if ':' in query:
        return query.split(':', 1)
    return query, None

If user pass the invalid token will cause internal server error, could you use try catch to catch the exception?

@lepture lepture self-assigned this Feb 13, 2018
@lepture lepture added this to the Version 0.6 milestone Feb 13, 2018
@lepture
Copy link
Owner

lepture commented Feb 13, 2018

@nggary Thanks for your reporting, it is fixed in the master.

@lepture lepture added the bug label Feb 28, 2018
coopfeathy added a commit to coopfeathy/authlib-django that referenced this issue Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants