public class Auth
extends java.lang.Object
AuthActivity
Constructor and Description |
---|
Auth() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getOAuth2Token() |
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.
|
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 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 an partner who registered your app with openwith feature in our official Dropbox app.
context
- the Context
which 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()