Class OAuth2TokenResponse
- java.lang.Object
-
- com.sap.cloud.security.xsuaa.client.OAuth2TokenResponse
-
public class OAuth2TokenResponse extends Object
-
-
Constructor Summary
Constructors Constructor Description OAuth2TokenResponse(String accessToken, long expiredInSeconds, String refreshToken)OAuth2TokenResponse(String accessToken, long expiredInSeconds, String refreshToken, String tokenType)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetAccessToken()An OAuth2 access token.DecodedJwtgetDecodedAccessToken()A decoded OAuth2 access token.InstantgetExpiredAt()Returns the moment in time when the token will be expired.DategetExpiredAtDate()Deprecated.usegetExpiredAt().StringgetRefreshToken()An OAuth2 refresh token.StringgetTokenType()StringtoString()
-
-
-
Method Detail
-
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
-
getExpiredAtDate
@Deprecated public Date getExpiredAtDate()
Deprecated.usegetExpiredAt().Returns the moment in time when the token will be expired.- Returns:
- the expiration point in time if present.
-
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()
-
-