Package com.dropbox.core
Class DbxAuthFinish
- java.lang.Object
-
- com.dropbox.core.DbxAuthFinish
-
public final class DbxAuthFinish extends java.lang.Object
When you successfully complete the authorization process, the Dropbox server returns this information to you.
-
-
Field Summary
Fields Modifier and Type Field Description static JsonReader<java.lang.String>
AccessTokenReader
static JsonReader<java.lang.String>
BearerTokenTypeReader
static JsonReader<DbxAuthFinish>
Reader
For JSON parsing.
-
Constructor Summary
Constructors Constructor Description DbxAuthFinish(java.lang.String accessToken, java.lang.Long expiresIn, java.lang.String refreshToken, java.lang.String userId, java.lang.String teamId, java.lang.String accountId, java.lang.String urlState)
DbxAuthFinish(java.lang.String accessToken, java.lang.Long expiresIn, java.lang.String refreshToken, java.lang.String userId, java.lang.String teamId, java.lang.String accountId, java.lang.String urlState, java.lang.String scope)
DbxAuthFinish(java.lang.String accessToken, java.lang.String userId, java.lang.String accountId, java.lang.String teamId, java.lang.String urlState)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccessToken()
Returns an access token that can be used to make Dropbox API calls.java.lang.String
getAccountId()
Returns the Dropbox account ID of the user who just approved your app for access to their Dropbox account.java.lang.Long
getExpiresAt()
Returns the time whenaccessToken
expires in millisecond.java.lang.String
getRefreshToken()
Returns an refresh token which can be used to obtain newaccessToken
.java.lang.String
getScope()
Return the scopes of current OAuth flow.java.lang.String
getTeamId()
Returns the Dropbox team ID of the team's user who just approved your app for access to their Dropbox account.java.lang.String
getUrlState()
Returns the state data you passed in toDbxWebAuth.start(java.lang.String)
.java.lang.String
getUserId()
Returns the Dropbox user ID of the user who just approved your app for access to their Dropbox account.
-
-
-
Field Detail
-
Reader
public static final JsonReader<DbxAuthFinish> Reader
For JSON parsing.
-
BearerTokenTypeReader
public static final JsonReader<java.lang.String> BearerTokenTypeReader
-
AccessTokenReader
public static final JsonReader<java.lang.String> AccessTokenReader
-
-
Constructor Detail
-
DbxAuthFinish
@Deprecated public DbxAuthFinish(java.lang.String accessToken, java.lang.String userId, java.lang.String accountId, java.lang.String teamId, java.lang.String urlState)
Deprecated.- Parameters:
accessToken
- OAuth access tokenuserId
- Dropbox user ID of user that approved access to this appurlState
- State data passed in toDbxWebAuth.start(java.lang.String)
ornull
if no state was passed
-
DbxAuthFinish
public DbxAuthFinish(java.lang.String accessToken, java.lang.Long expiresIn, java.lang.String refreshToken, java.lang.String userId, java.lang.String teamId, java.lang.String accountId, java.lang.String urlState)
- Parameters:
accessToken
- OAuth access token.expiresIn
- Duration time of accessToken in second.refreshToken
- A token used to obtain new accessToken.userId
- Dropbox user ID of user that authorized this app.teamId
- Dropbox team ID of team that authorized this app.accountId
- Obfusticated user or team id. Keep it safe.urlState
- State data passed in toDbxWebAuth.start(java.lang.String)
ornull
if no state was passed
-
DbxAuthFinish
public DbxAuthFinish(java.lang.String accessToken, java.lang.Long expiresIn, java.lang.String refreshToken, java.lang.String userId, java.lang.String teamId, java.lang.String accountId, java.lang.String urlState, java.lang.String scope)
- Parameters:
accessToken
- OAuth access token.expiresIn
- Duration time of accessToken in second.refreshToken
- A token used to obtain new accessToken.userId
- Dropbox user ID of user that authorized this app.teamId
- Dropbox team ID of team that authorized this app.accountId
- Obfusticated user or team id. Keep it safe.urlState
- State data passed in toDbxWebAuth.start(java.lang.String)
ornull
if no state was passedscope
- A list of scope returned by Dropbox server. Each scope correspond to a group of API endpoints. To call one API endpoint you have to obtains the scope first otherwise you will get HTTP 401.
-
-
Method Detail
-
getAccessToken
public java.lang.String getAccessToken()
Returns an access token that can be used to make Dropbox API calls. Pass this in to theDbxClientV2
constructor.- Returns:
- OAuth access token used for authorization with Dropbox servers
-
getExpiresAt
public java.lang.Long getExpiresAt()
Returns the time whenaccessToken
expires in millisecond. If null then it won't expire. Pass this in to theDbxClientV2
constructor.- Returns:
- OAuth access token used for authorization with Dropbox servers
-
getRefreshToken
public java.lang.String getRefreshToken()
Returns an refresh token which can be used to obtain newaccessToken
. Pass this in to theDbxClientV2
constructor.- Returns:
- OAuth access token used for authorization with Dropbox servers
-
getUserId
public java.lang.String getUserId()
Returns the Dropbox user ID of the user who just approved your app for access to their Dropbox account. We use user ID to identify user in API V1.- Returns:
- Dropbox user ID of user that approved your app for access to their account
-
getAccountId
public java.lang.String getAccountId()
Returns the Dropbox account ID of the user who just approved your app for access to their Dropbox account. We use account ID to identify user in API V2.- Returns:
- Dropbox account ID of user that approved your app for access to their account
-
getTeamId
public java.lang.String getTeamId()
Returns the Dropbox team ID of the team's user who just approved your app for access to their Dropbox account. We use team ID to identify team in API V2.- Returns:
- Dropbox team ID of team's that approved your app for access to their account
-
getScope
public java.lang.String getScope()
Return the scopes of current OAuth flow. Each scope correspond to a group of API endpoints. To call one API endpoint you have to obtains the scope first otherwise you will get HTTP 401.
-
getUrlState
public java.lang.String getUrlState()
Returns the state data you passed in toDbxWebAuth.start(java.lang.String)
. If you didn't pass anything in, or you usedDbxWebAuthNoRedirect
, this will benull
.- Returns:
- state data passed into
DbxWebAuth.start(java.lang.String)
, ornull
if no state was passed
-
-