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

Feature request: Support for client_credentials grant #118

Closed
fritzdj opened this issue Mar 2, 2019 · 3 comments
Closed

Feature request: Support for client_credentials grant #118

fritzdj opened this issue Mar 2, 2019 · 3 comments
Labels

Comments

@fritzdj
Copy link

fritzdj commented Mar 2, 2019

We would like to use the client_credentials flow (specifically we want to use the @RegisteredOAuth2AuthorizedClient annotation), but if client info is added when using this dependency it's automatically running OktaOAuth2Configurer.configureLogin. Would it make sense to check the grant type first before doing that and calling a new configureClient method that sets up the client using http.oauth2Client() if grant type is client_credentials? We would not want to set up http.oauth2Login() in that case.
https://github.com/okta/okta-spring-boot/blob/master/oauth2/src/main/java/com/okta/spring/boot/oauth/OktaOAuth2Configurer.java#L47

Side note - @bdemers, great work on this project. This was a great project to learn from so thanks for contributing this as OSS.

@fritzdj
Copy link
Author

fritzdj commented Mar 11, 2019

A side note on this one - it's unclear what the best pattern is for getting new access tokens Spring Security 5 and the client credentials grant. It seems like with @RegisteredOAuth2AuthorizedClient the authorized client stays static. Would we need a custom implementation to (1) check if there is an authorized client, (2) check the access token expired time, and (3) get a new access token if needed? There may be something I am missing that comes OOTB here.

@bdemers
Copy link
Contributor

bdemers commented Mar 11, 2019

@fritzdj IIRC, all of that is OOTB

@fritzdj
Copy link
Author

fritzdj commented Mar 13, 2019

See spring-projects/spring-security#6609 - this was actually never implemented

@fritzdj fritzdj closed this as completed Aug 15, 2021
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