Class OAuth2TokenResponse

java.lang.Object
com.sap.cloud.security.xsuaa.client.OAuth2TokenResponse

public class OAuth2TokenResponse extends Object
  • Constructor Details

    • OAuth2TokenResponse

      public OAuth2TokenResponse(@Nullable String accessToken, long expiredInSeconds, @Nullable String refreshToken)
    • OAuth2TokenResponse

      public OAuth2TokenResponse(@Nullable String accessToken, long expiredInSeconds, @Nullable String refreshToken, String tokenType)
  • Method Details

    • getAccessToken

      @Nullable public String getAccessToken()
      An OAuth2 access token. This token will be a JSON Web Token suitable for offline validation by OAuth2 Resource Servers.
      Returns:
      the encoded access token
    • getDecodedAccessToken

      @Nullable public DecodedJwt getDecodedAccessToken()
      A decoded OAuth2 access token.
      Returns:
      the decoded access token
    • getExpiredAt

      public Instant getExpiredAt()
      Returns the moment in time when the token will be expired.
      Returns:
      the expiration point in time if present.
    • getRefreshToken

      @Nullable public String getRefreshToken()
      An OAuth2 refresh token. Clients typically use the refresh token to obtain a new access token without the need for the user to authenticate again.

      Note with version 2.5.0 the UserTokenFlow (Jwt Bearer) does not provide any longer Refresh Token.

      Returns:
      the refresh token - can only be used once!
    • getTokenType

      public String getTokenType()
    • toString

      public String toString()
      Overrides:
      toString in class Object