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

Implement custom token extractor #49

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

blablacio
Copy link
Contributor

I've been working on a websocket API for some time and just realized that browsers still don't support setting headers like Authorization (or anything else other than Sec-WebSocket-Protocol), which makes things a little bit more complicated.

So, now I'm wondering what would be the most straightforward and flexible way to allow for custom token extraction?

I was thinking that probably adding a new token_extractor field on Authorizer and AuthorizerBuilder along with a method on the builder to allow passing an extractor function would be the easiest way to extend token extraction without touching the JwtSource enum.

Might be a good idea to skip setting the token_extractor entirely if jwt_source is passed, but not sure about that.

Let me know what you think and if there's a better way to go about this.

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

Successfully merging this pull request may close these issues.

1 participant