Package com.spotify.sdk.android.auth
Class TokenExchangeResponse
- java.lang.Object
-
- com.spotify.sdk.android.auth.TokenExchangeResponse
-
public class TokenExchangeResponse extends java.lang.Object
Response from a token exchange request. Contains either the access token information or error details.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccessToken()
java.lang.String
getError()
java.lang.String
getErrorDescription()
int
getExpiresIn()
java.lang.String
getRefreshToken()
java.lang.String
getScope()
java.lang.String
getTokenType()
boolean
isSuccess()
-
-
-
Method Detail
-
isSuccess
public boolean isSuccess()
- Returns:
- true if the token exchange was successful, false otherwise
-
getAccessToken
@Nullable public java.lang.String getAccessToken()
- Returns:
- the access token if successful, null otherwise
-
getTokenType
@Nullable public java.lang.String getTokenType()
- Returns:
- the token type (usually "Bearer") if successful, null otherwise
-
getExpiresIn
public int getExpiresIn()
- Returns:
- the number of seconds the access token is valid for, 0 if not provided or on error
-
getScope
@Nullable public java.lang.String getScope()
- Returns:
- the scope of the access token if provided, null otherwise
-
getRefreshToken
@Nullable public java.lang.String getRefreshToken()
- Returns:
- the refresh token if provided, null otherwise
-
getError
@Nullable public java.lang.String getError()
- Returns:
- the error code if the request failed, null if successful
-
getErrorDescription
@Nullable public java.lang.String getErrorDescription()
- Returns:
- the error description if the request failed, null if successful
-
-