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

Add authorization parsing methods #40

Closed
jeremydaly opened this Issue May 2, 2018 · 2 comments

Comments

Projects
None yet
1 participant
@jeremydaly
Copy link
Owner

jeremydaly commented May 2, 2018

For most of my apps I'm extracting a bearer token from the authorization header. Might be nice to have this common use case canned. I'll also need to research some other common forms and see if those will be easy enough to implement as well.

@jeremydaly jeremydaly added this to the v0.6 milestone May 2, 2018

@jeremydaly

This comment has been minimized.

Copy link
Owner

jeremydaly commented May 15, 2018

I did some research using this as a reference: https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml. It looks like most of these boil down to just using the Bearer method. JWT and OAuth2 are passed with Bearer, so other than maybe supporting Basic, which seems like a bad idea, I'm not sure there is a need to provide convenience methods for the others.

If someone is still using Digest or OAuth 1.0, let me know.

@jeremydaly

This comment has been minimized.

Copy link
Owner

jeremydaly commented May 15, 2018

Added support for Bearer, Basic, Digest and OAuth. It returns an object with a type and value that contain the appropriate values. Basic will decode the base64 value and extend the object with username and password. OAuth will extend the object with key/value pairs for all the inputs.

@jeremydaly jeremydaly closed this May 16, 2018

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