Class RefreshTokenFlow
java.lang.Object
com.sap.cloud.security.xsuaa.tokenflows.RefreshTokenFlow
A refresh token flow builder.
Applications can use this flow exchange a given refresh token for a (refreshed) JWT token.
Applications can use this flow exchange a given refresh token for a (refreshed) JWT token.
-
Method Summary
Modifier and TypeMethodDescriptiondisableCache(boolean disableCache) Can be used to disable the cache for the flow.execute()Executes the refresh token flow against XSUAA.refreshToken(String refreshToken) Sets the mandatory refresh token to be exchanged for a (refreshed) JWT.Sets the subdomain (tenant) the token is requested for.
-
Method Details
-
subdomain
Sets the subdomain (tenant) the token is requested for.- Parameters:
subdomain- - the subdomain.- Returns:
- this builder.
-
refreshToken
Sets the mandatory refresh token to be exchanged for a (refreshed) JWT.- Parameters:
refreshToken- - the refresh token to be exchanged for a JWT.- Returns:
- this builder object.
-
disableCache
Can be used to disable the cache for the flow.- Parameters:
disableCache- - disables cache when set totrue.- Returns:
- this builder.
-
execute
public OAuth2TokenResponse execute() throws IllegalStateException, IllegalArgumentException, TokenFlowExceptionExecutes the refresh token flow against XSUAA.- Returns:
- the refreshed OAuth access token returned by XSUAA or an exception in case the token could not be refreshed.
- Throws:
IllegalStateException- - in case not all mandatory fields of the token flow request have been set.IllegalArgumentException- - in case the refresh token flow request is not valid.TokenFlowException- - in case of an error during the flow, or when the token cannot be refreshed.
-