Package com.dropbox.core.android
Class Auth
- java.lang.Object
- 
- com.dropbox.core.android.Auth
 
- 
 public class Auth extends java.lang.ObjectHelper class for integrating withAuthActivity
- 
- 
Constructor SummaryConstructors Constructor Description Auth()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static DbxCredentialgetDbxCredential()static java.lang.StringgetOAuth2Token()static java.lang.StringgetScope()Get the scope authorized in this OAuth flow.static java.lang.StringgetUid()static voidstartOAuth2Authentication(android.content.Context context, java.lang.String appKey)static voidstartOAuth2Authentication(android.content.Context context, java.lang.String appKey, java.lang.String desiredUid, java.lang.String[] alreadyAuthedUids, java.lang.String sessionId)static voidstartOAuth2Authentication(android.content.Context context, java.lang.String appKey, java.lang.String desiredUid, java.lang.String[] alreadyAuthedUids, java.lang.String sessionId, java.lang.String webHost)Starts the Dropbox authentication process by launching an external app (either the Dropbox app if available or a web browser) where the user will log in and allow your app access.static voidstartOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig)static voidstartOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host)Starts the Dropbox OAuth process by launching the Dropbox official app (AKA DAuth) or web browser if dropbox official app is not available.static voidstartOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host, java.util.Collection<java.lang.String> scope)static voidstartOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host, java.util.Collection<java.lang.String> scope, IncludeGrantedScopes includeGrantedScopes)Starts the Dropbox OAuth process by launching the Dropbox official app (AKA DAuth) or web browser if dropbox official app is not available.static voidstartOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, java.util.Collection<java.lang.String> scope)
 
- 
- 
- 
Method Detail- 
startOAuth2Authenticationpublic static void startOAuth2Authentication(android.content.Context context, java.lang.String appKey)
 - 
startOAuth2Authenticationpublic static void startOAuth2Authentication(android.content.Context context, java.lang.String appKey, java.lang.String desiredUid, java.lang.String[] alreadyAuthedUids, java.lang.String sessionId)
 - 
startOAuth2PKCEpublic static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig)
 - 
startOAuth2PKCEpublic static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, java.util.Collection<java.lang.String> scope)- Parameters:
- scope- A list of scope strings. 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.
- See Also:
- startOAuth2PKCE(Context, String, DbxRequestConfig, DbxHost)
 
 - 
startOAuth2PKCEpublic static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host)Starts the Dropbox OAuth process by launching the Dropbox official app (AKA DAuth) or web browser if dropbox official app is not available. In browser flow, normally user needs to sign in.- Parameters:
- context- the- Contextto use to launch the * Dropbox authentication activity. This will typically be an *- Activityand the user will be taken back to that * activity after authentication is complete (i.e., your activity * will receive an- onResume()).
- appKey- the app's key.
- requestConfig- Default attributes to use for each request
- host- Dropbox hosts to send requests to (used for mocking and testing)
 
 - 
startOAuth2PKCEpublic static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host, java.util.Collection<java.lang.String> scope)
 - 
startOAuth2PKCEpublic static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host, java.util.Collection<java.lang.String> scope, IncludeGrantedScopes includeGrantedScopes)Starts the Dropbox OAuth process by launching the Dropbox official app (AKA DAuth) or web browser if dropbox official app is not available. In browser flow, normally user needs to sign in.- Parameters:
- context- the- Contextto use to launch the * Dropbox authentication activity. This will typically be an *- Activityand the user will be taken back to that * activity after authentication is complete (i.e., your activity * will receive an- onResume()).
- appKey- the app's key.
- requestConfig- Default attributes to use for each request
- host- Dropbox hosts to send requests to (used for mocking and testing)
- scope- A list of scope strings. 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.
- includeGrantedScopes- If this is set, result will contain both new scopes and all previously granted scopes. It enables incrementally requesting scopes.
 
 - 
startOAuth2Authenticationpublic static void startOAuth2Authentication(android.content.Context context, java.lang.String appKey, java.lang.String desiredUid, java.lang.String[] alreadyAuthedUids, java.lang.String sessionId, java.lang.String webHost)Starts the Dropbox authentication process by launching an external app (either the Dropbox app if available or a web browser) where the user will log in and allow your app access.This variant should be used when authentication is being done due to an OpenWith request through action "com.dropbox.android.intent.action.DBXC_EDIT" and "com.dropbox.android.intent.action.DBXC_VIEW". You won't need to use this unless you are a partner who registered your app with openwith feature in our official Dropbox app. - Parameters:
- context- the- Contextto use to launch the Dropbox authentication activity. This will typically be an- Activityand the user will be taken back to that activity after authentication is complete (i.e., your activity will receive an- onResume()).
- appKey- the app's key.
- desiredUid- Encourage user to authenticate account defined by this uid. (note that user still can authenticate other accounts). May be null if no uid desired.
- alreadyAuthedUids- Array of any other uids currently authenticated with this app. May be null if no uids previously authenticated. Authentication screen will encourage user to not authorize these user accounts. (note that user may still authorize the accounts).
- sessionId- The SESSION_ID Extra on an OpenWith intent. null if dAuth is being launched outside of OpenWith flow
- webHost- Server host used for oauth
- Throws:
- java.lang.IllegalStateException- if you have not correctly set up the AuthActivity in your manifest, meaning that the Dropbox app will not be able to redirect back to your app after auth.
 
 - 
getOAuth2Tokenpublic static java.lang.String getOAuth2Token() 
 - 
getUidpublic static java.lang.String getUid() 
 - 
getDbxCredentialpublic static DbxCredential getDbxCredential() - Returns:
- The result after
 
 - 
getScopepublic static java.lang.String getScope() Get the scope authorized in this OAuth flow.- Returns:
- 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.
 
 
- 
 
-