Skip to content

Allow customization for ServerBearerTokenAuthenticationConverter #10502

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

Closed
nightswimmings opened this issue Nov 12, 2021 · 4 comments
Closed
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@nightswimmings
Copy link

ServerBearerTokenAuthenticationConverter does not offer too many options for customization:

  • All its methods are private, so not overridable
  • Only customization options are setAllowUriQueryParameter and setBearerTokenHeaderName
  • It would be great if authorizationPattern could be configurable, or at least the "Bearer" part ignorable; as well as parameterToken
  • It would be great if allowed for looking the jwt from a cookie, or at least easy to extend in order to embed this behavior
  • It would be great if this could be autconfigured by simlpy exposing it as @bean, like servlet's BearerTokenResolver counterpart
    I know some are not oauth2 compliant, but it can serve similar systems and they don't hurt if not used as defaults anyway

Thanks!

@nightswimmings nightswimmings added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Nov 12, 2021
@sjohnr
Copy link
Member

sjohnr commented Nov 15, 2021

Hi @nightswimmings, thanks for the enhancement suggestion.

I wonder if you could be more specific with details of your use case? There are quite a few suggestions in your description but not many details on what you're trying to do. Would implementing the ServerAuthenticationConverter interface directly be achievable to solve your use case? Are there any challenges with implementing it yourself?

@sjohnr sjohnr self-assigned this Nov 15, 2021
@sjohnr sjohnr added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 15, 2021
@jzheaux
Copy link
Contributor

jzheaux commented Nov 15, 2021

It would be great if allowed for looking the jwt from a cookie, or at least easy to extend in order to embed this behavior

Note a related ticket #9230

@nightswimmings
Copy link
Author

nightswimmings commented Nov 16, 2021

Hi @sjohnr. I had to inherit ServerAuthenticationConverter , yes, but I thought there was no reason to avoid proposing having flexibility once we have ServerBearerTokenAuthenticationConverter. Frankly, the cookie part is the biggest miss in my use case @jzheaux

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 16, 2021
@sjohnr
Copy link
Member

sjohnr commented Nov 16, 2021

Ok, great. Thanks @nightswimmings! So for now, I'm going to close this as a duplicate of #9230, thanks @jzheaux. If there's anything else from this issue you'd like to discuss, we can reopen and do that.

@sjohnr sjohnr closed this as completed Nov 16, 2021
@sjohnr sjohnr added status: duplicate A duplicate of another issue and removed status: feedback-provided Feedback has been provided labels Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants