Skip to content

Provide support for refresh_token grant #4371

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
jgrandja opened this issue Jun 6, 2017 · 4 comments
Closed

Provide support for refresh_token grant #4371

jgrandja opened this issue Jun 6, 2017 · 4 comments
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Milestone

Comments

@jgrandja
Copy link
Contributor

jgrandja commented Jun 6, 2017

We need to provide WebClient support for refreshing an expired access token.

Spec references:

Related #4921

@jgrandja jgrandja added the in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) label Jun 6, 2017
@jgrandja jgrandja added this to the 5.0.0.M2 milestone Jun 6, 2017
@jgrandja jgrandja self-assigned this Jun 6, 2017
@rwinch rwinch modified the milestones: 5.0.0.M2, 5.0.0.M3 Jun 15, 2017
@jgrandja jgrandja modified the milestones: 5.0.0.M3, 5.0.0.M4 Jul 24, 2017
@jgrandja jgrandja mentioned this issue Aug 15, 2017
28 tasks
@jgrandja jgrandja removed this from the 5.0.0.M4 milestone Sep 13, 2017
@jgrandja jgrandja added this to the 5.1.0.M1 milestone Dec 12, 2017
@jgrandja
Copy link
Contributor Author

Related #4509

@gregsimons
Copy link

@jgrandja is any of the refresh token repository available in a snapshot form at the moment?

@jgrandja
Copy link
Contributor Author

jgrandja commented May 10, 2018

@gregsimons No not at the moment. The HTTP Client integration (e.g. #4921) needs to be implemented first before we tackle this one. We're still planning on getting this in for 5.1 release.

@rwinch
Copy link
Member

rwinch commented Jul 2, 2018

Fixed via 0116c65

Users can now use the following:

WebClient webClient = WebClient.builder()
	.filter(new ServerOAuth2AuthorizedClientExchangeFilterFunction(authorizedClientService))
	.build();
// ....
Mono<String>  response = webClient.get()
	.uri(uri)
	.attributes(oauth2AuthorizedClient(authorizedClient))
	// ...
	.retrieve()
	.bodyToMono(String.class);  

If the access token is about to expire and it has a corresponding refresh token, then it will automatically be refreshed and saved. After the refresh is complete, the original request will be made with the updated access token.

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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants