public class OAuthActivity
extends Activity
Activity#RESULT_CANCELED
together will a error message in
intent extra.Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ALLOW_LOAD_REDIRECT_PAGE |
static java.lang.String |
BOX_CLIENT_OAUTH |
static java.lang.String |
BOX_DEVICE_ID |
static java.lang.String |
BOX_DEVICE_NAME |
protected static java.lang.String |
CLIENT_ID |
protected static java.lang.String |
CLIENT_SECRET |
static java.lang.String |
ERROR_MESSAGE |
protected static java.lang.String |
REDIRECT_URL |
Constructor and Description |
---|
OAuthActivity() |
Modifier and Type | Method and Description |
---|---|
static Intent |
createOAuthActivityIntent(Context context,
java.lang.String clientId,
java.lang.String clientSecret)
Create intent to launch OAuthActivity,use this method only if you already set redirect url in box
dev console and you want to show the redirect page at the end of OAuth flow.
|
static Intent |
createOAuthActivityIntent(Context context,
java.lang.String clientId,
java.lang.String clientSecret,
boolean allowShowRedirectPage)
Create intent to launch OAuthActivity, use this method only if you already set redirect url in box dev console.
|
static Intent |
createOAuthActivityIntent(Context context,
java.lang.String clientId,
java.lang.String clientSecret,
boolean allowShowRedirectPage,
java.lang.String redirectUrl)
Create intent to launch OAuthActivity.
|
protected int |
getContentView() |
void |
onCreate(Bundle savedInstanceState) |
protected void |
startOAuth(java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String redirectUrl,
boolean allowShowRedirect,
java.lang.String deviceId,
java.lang.String deviceName)
Start oauth flow.
|
public static final java.lang.String ERROR_MESSAGE
public static final java.lang.String BOX_CLIENT_OAUTH
public static final java.lang.String BOX_DEVICE_ID
public static final java.lang.String BOX_DEVICE_NAME
protected static final java.lang.String CLIENT_ID
protected static final java.lang.String CLIENT_SECRET
protected static final java.lang.String REDIRECT_URL
protected static final java.lang.String ALLOW_LOAD_REDIRECT_PAGE
public void onCreate(Bundle savedInstanceState)
protected int getContentView()
protected void startOAuth(java.lang.String clientId, java.lang.String clientSecret, java.lang.String redirectUrl, boolean allowShowRedirect, java.lang.String deviceId, java.lang.String deviceName)
clientId
- clientSecret
- redirectUrl
- allowShowRedirect
- deviceName
- deviceId
- public static Intent createOAuthActivityIntent(Context context, java.lang.String clientId, java.lang.String clientSecret)
context
- contextclientId
- your box client idclientSecret
- your box client secretpublic static Intent createOAuthActivityIntent(Context context, java.lang.String clientId, java.lang.String clientSecret, boolean allowShowRedirectPage)
context
- contextclientId
- your box client idclientSecret
- your box client secretallowShowRedirectPage
- Whether you want to load/show redirected page after OAuth flow is done.public static Intent createOAuthActivityIntent(Context context, java.lang.String clientId, java.lang.String clientSecret, boolean allowShowRedirectPage, java.lang.String redirectUrl)
context
- contextclientId
- your box client idclientSecret
- your box client secretallowShowRedirectPage
- Whether you want to load/show redirected page after OAuth flow is done.redirectUrl
- redirect url, if you already set redirect url in box dev console, leave this null
or use the same url, otherwise this field is required. You can use "http://localhost" if you don't have a redirect server.