Class OneDriveAuthInfo
java.lang.Object
com.amilesend.onedrive.connection.auth.OneDriveAuthInfo
- All Implemented Interfaces:
com.amilesend.client.connection.auth.AuthInfo
public class OneDriveAuthInfo
extends Object
implements com.amilesend.client.connection.auth.AuthInfo
Represents the authentication information for OAuth (OBO) access to a user's MS OneDrive account.
This is returned in response when making calls to acquire the initial token or when refreshing the token.
Note: For business accounts, the auth tokens are only valid with a single resource. If
the user is to access a different resource (different service/site), then new access tokens are required.
See BusinessAccountAuthManager for more information.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()copyWithResourceId(String resourceId) Creates a copy of this object while injecting the givenresourceId.booleanstatic OneDriveAuthInfoDeserializes the givenauthInfoJsonstring to a newAuthInfoobject.@NonNull StringThe current authorization token used to make API requests.longTime in milliseconds when the auth token expires.longTime in milliseconds when the auth token expires.Gets the full token that is used in request headers to sign API requests.@NonNull StringThe current refresh token used to refresh access tokens.The associated resource identifier associated with the access tokens (business accounts only).The list of scopes, or permissions to access the Graph API.The auth token type.inthashCode()toJson()Serializes thisAuthInfoto a JSON formatted string.
-
Method Details
-
fromJson
Deserializes the givenauthInfoJsonstring to a newAuthInfoobject.- Parameters:
authInfoJson- the JSON-formatted auth info- Returns:
- the new
AuthInfoobject - Throws:
com.google.gson.JsonSyntaxException- if there is an error while deserializing the JSON string
-
getFullToken
Gets the full token that is used in request headers to sign API requests. Full token strings are formatted as"[Token Type] [Access token]"- Returns:
- the full token
-
toJson
Serializes thisAuthInfoto a JSON formatted string.- Returns:
- the JSON formatted
AuthInfo
-
copyWithResourceId
Creates a copy of this object while injecting the givenresourceId.- Parameters:
resourceId- the resource identifier associated with the auth tokens- Returns:
- the copy
-
builder
-
getTokenType
The auth token type. Default isBearer. -
getScopes
-
getExpiresIn
public long getExpiresIn()Time in milliseconds when the auth token expires. -
getExtExpiresIn
public long getExtExpiresIn()Time in milliseconds when the auth token expires. -
getAccessToken
The current authorization token used to make API requests. -
getRefreshToken
The current refresh token used to refresh access tokens. -
getResourceId
The associated resource identifier associated with the access tokens (business accounts only). -
equals
-
hashCode
-