-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat: support multiple extract token key #4328
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
Would you please give some examples on how to use different token keys? For example, how to request the API with curl. |
c2d7e29
to
a01f817
Compare
According to the a-api.yaml configuration file, the
example:
If the setting curl --request GET \
--url http://127.0.0.1:8888/greet/from/me \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MjQ3NjUwMjR9.OvLg2ook9yVdBseQYkMO5wmdokYNGuaDMSa1dNkSeo8' \
--header 'content-type: application/json' |
Implement support for multiple custom token keys and simplify the JWT authentication configuration. `WithTokenKeys` function enables setting token keys, improving the authentication process by accommodating various token header extraction strategies. by accommodating various token header extraction strategies.
a01f817
to
a3f44cf
Compare
Bearer is the standard schema, is there any official spec that talks about Bearer replacement? |
Extracting JWT from different request sources (headers, query params, form data) is now configurable via `TokenLookup`.
I look up https://golang-jwt.github.io/jwt/#jwt-and-oauth-20 have mention a point
This feature is also supported in other frameworks/libraries.
|
Implement support for multiple custom token keys and simplify the JWT authentication configuration.
WithTokenLookups
function enables setting token keys, improving the authentication process by accommodating various token header extraction strategies. by accommodating various token header extraction strategies.example:
jwt-api.api
a-api.yaml
TokenLookup
extract a jwt from custom request header or post form or get url arguments.