public class Auth
extends java.lang.Object
AuthActivity
Constructor and Description |
---|
Auth() |
Modifier and Type | Method and Description |
---|---|
static DbxCredential |
getDbxCredential() |
static java.lang.String |
getOAuth2Token() |
static java.lang.String |
getScope()
Get the scope authorized in this OAuth flow.
|
static java.lang.String |
getUid() |
static void |
startOAuth2Authentication(android.content.Context context,
java.lang.String appKey) |
static void |
startOAuth2Authentication(android.content.Context context,
java.lang.String appKey,
java.lang.String desiredUid,
java.lang.String[] alreadyAuthedUids,
java.lang.String sessionId) |
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.
|
static void |
startOAuth2PKCE(android.content.Context context,
java.lang.String appKey,
DbxRequestConfig requestConfig) |
static void |
startOAuth2PKCE(android.content.Context context,
java.lang.String appKey,
DbxRequestConfig requestConfig,
java.util.Collection<java.lang.String> scope) |
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.
|
static void |
startOAuth2PKCE(android.content.Context context,
java.lang.String appKey,
DbxRequestConfig requestConfig,
DbxHost host,
java.util.Collection<java.lang.String> scope) |
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.
|
public static void startOAuth2Authentication(android.content.Context context, java.lang.String appKey)
public static void startOAuth2Authentication(android.content.Context context, java.lang.String appKey, java.lang.String desiredUid, java.lang.String[] alreadyAuthedUids, java.lang.String sessionId)
public static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig)
public static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, java.util.Collection<java.lang.String> scope)
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.startOAuth2PKCE(Context, String, DbxRequestConfig, DbxHost)
public static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host)
context
- the Context
to use to launch the
* Dropbox authentication activity. This will typically be an
* Activity
and 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 requesthost
- Dropbox hosts to send requests to (used for mocking and testing)public static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host, java.util.Collection<java.lang.String> scope)
public static void startOAuth2PKCE(android.content.Context context, java.lang.String appKey, DbxRequestConfig requestConfig, DbxHost host, java.util.Collection<java.lang.String> scope, IncludeGrantedScopes includeGrantedScopes)
context
- the Context
to use to launch the
* Dropbox authentication activity. This will typically be an
* Activity
and 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 requesthost
- 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.public 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)
This variant should be used when authentication is being done due to an OpenWith request through action and . You won't need to use this unless you are a partner who registered your app with openwith feature in our official Dropbox app.
context
- the Context
to use to launch the
Dropbox authentication activity. This will typically be an
Activity
and 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 flowwebHost
- Server host used for oauthjava.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.public static java.lang.String getOAuth2Token()
public static java.lang.String getUid()
public static DbxCredential getDbxCredential()
public static java.lang.String getScope()