Class DbxAuthFinish

java.lang.Object
com.dropbox.core.DbxAuthFinish

public final class DbxAuthFinish extends Object
When you successfully complete the authorization process, the Dropbox server returns this information to you.
  • Field Details

  • Constructor Details

    • DbxAuthFinish

      @Deprecated public DbxAuthFinish(String accessToken, String userId, String accountId, String teamId, String urlState)
      Deprecated.
      Parameters:
      accessToken - OAuth access token
      userId - Dropbox user ID of user that approved access to this app
      urlState - State data passed in to DbxWebAuth.start(java.lang.String) or null if no state was passed
    • DbxAuthFinish

      public DbxAuthFinish(String accessToken, Long expiresIn, String refreshToken, String userId, String teamId, String accountId, 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 to DbxWebAuth.start(java.lang.String) or null if no state was passed
    • DbxAuthFinish

      public DbxAuthFinish(String accessToken, Long expiresIn, String refreshToken, String userId, String teamId, String accountId, String urlState, 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 to DbxWebAuth.start(java.lang.String) or null if no state was passed
      scope - 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 Details

    • getAccessToken

      public String getAccessToken()
      Returns an access token that can be used to make Dropbox API calls. Pass this in to the DbxClientV2 constructor.
      Returns:
      OAuth access token used for authorization with Dropbox servers
    • getExpiresAt

      public Long getExpiresAt()
      Returns the time when accessToken expires in millisecond. If null then it won't expire. Pass this in to the DbxClientV2 constructor.
      Returns:
      OAuth access token used for authorization with Dropbox servers
    • getRefreshToken

      public String getRefreshToken()
      Returns an refresh token which can be used to obtain new accessToken . Pass this in to the DbxClientV2 constructor.
      Returns:
      OAuth access token used for authorization with Dropbox servers
    • getUserId

      public 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 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 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 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 String getUrlState()
      Returns the state data you passed in to DbxWebAuth.start(java.lang.String). If you didn't pass anything in, or you used DbxWebAuthNoRedirect, this will be null.
      Returns:
      state data passed into DbxWebAuth.start(java.lang.String), or null if no state was passed