-
public class Auth.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static Auth.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final UnitstartOAuth2Authentication(Context context, String appKey)final UnitstartOAuth2Authentication(Context context, String appKey, String desiredUid, Array<String> alreadyAuthedUids, String sessionId)final UnitstartOAuth2Authentication(Context context, String appKey, String desiredUid, Array<String> alreadyAuthedUids, String sessionId, 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. final UnitstartOAuth2PKCE(Context context, String appKey, DbxRequestConfig requestConfig, Collection<String> scope)final UnitstartOAuth2PKCE(Context context, String appKey, DbxRequestConfig requestConfig)final UnitstartOAuth2PKCE(Context context, 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. final UnitstartOAuth2PKCE(Context context, String appKey, DbxRequestConfig requestConfig, DbxHost host, Collection<String> scope)final UnitstartOAuth2PKCE(Context context, String appKey, DbxRequestConfig requestConfig, DbxHost host, Collection<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. final StringgetOAuth2Token()final StringgetUid()final DbxCredentialgetDbxCredential()final StringgetScope()Get the scope authorized in this OAuth flow. -
-
Method Detail
-
startOAuth2Authentication
final Unit startOAuth2Authentication(Context context, String appKey)
-
startOAuth2Authentication
final Unit startOAuth2Authentication(Context context, String appKey, String desiredUid, Array<String> alreadyAuthedUids, String sessionId)
-
startOAuth2Authentication
final Unit startOAuth2Authentication(Context context, String appKey, String desiredUid, Array<String> alreadyAuthedUids, String sessionId, 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 {@value DbxOfficialAppConnector#ACTION_DBXC_EDIT} and {@value DbxOfficialAppConnector#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 Context to use to launch the Dropbox authentication activity.appKey- the app's key.desiredUid- Encourage user to authenticate account defined by this uid.alreadyAuthedUids- Array of any other uids currently authenticated with this app.sessionId- The SESSION_ID Extra on an OpenWith intent.webHost- Server host used for oauth
-
startOAuth2PKCE
@JvmOverloads() final Unit startOAuth2PKCE(Context context, String appKey, DbxRequestConfig requestConfig, Collection<String> scope)
- Parameters:
scope- A list of scope strings.
-
startOAuth2PKCE
@JvmOverloads() final Unit startOAuth2PKCE(Context context, String appKey, DbxRequestConfig requestConfig)
-
startOAuth2PKCE
final Unit startOAuth2PKCE(Context context, 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 Context to use to launch theDropbox authentication activity. This will typically be an[Activity] and the user will be taken back to thatactivity after authentication is complete (i.e., your activitywill 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)
-
startOAuth2PKCE
final Unit startOAuth2PKCE(Context context, String appKey, DbxRequestConfig requestConfig, DbxHost host, Collection<String> scope)
-
startOAuth2PKCE
final Unit startOAuth2PKCE(Context context, String appKey, DbxRequestConfig requestConfig, DbxHost host, Collection<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 Context to use to launch theDropbox authentication activity. This will typically be an[Activity] and the user will be taken back to thatactivity after authentication is complete (i.e., your activitywill 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.includeGrantedScopes- If this is set, result will contain both new scopes and all previously granted scopes.
-
getOAuth2Token
final String getOAuth2Token()
-
getDbxCredential
final DbxCredential getDbxCredential()
-
-
-
-