Class RefreshTokenFlow

java.lang.Object
com.sap.cloud.security.xsuaa.tokenflows.RefreshTokenFlow

public class RefreshTokenFlow extends Object
A refresh token flow builder.
Applications can use this flow exchange a given refresh token for a (refreshed) JWT token.
  • Method Details

    • subdomain

      public RefreshTokenFlow subdomain(String subdomain)
      Sets the subdomain (tenant) the token is requested for.
      Parameters:
      subdomain - - the subdomain.
      Returns:
      this builder.
    • refreshToken

      public RefreshTokenFlow refreshToken(String 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

      public RefreshTokenFlow disableCache(boolean disableCache)
      Can be used to disable the cache for the flow.
      Parameters:
      disableCache - - disables cache when set to true.
      Returns:
      this builder.
    • execute

      Executes 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.