public class BoxAuthentication
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
BoxAuthentication.AuthListener
Interface of a listener to listen to authentication events.
|
static class |
BoxAuthentication.AuthStorage
Storage class to store auth info.
|
static class |
BoxAuthentication.BoxAuthenticationInfo
Object holding authentication info.
|
static class |
BoxAuthentication.NonDefaultClientLogoutException
Exception if user cannot be logged out using the default BoxConfig client id/secret.
|
| Modifier and Type | Field and Description |
|---|---|
static java.util.concurrent.ThreadPoolExecutor |
AUTH_EXECUTOR |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(BoxAuthentication.AuthListener listener)
Add listener to listen to the authentication process for this BoxSession.
|
BoxAuthentication.BoxAuthenticationInfo |
getAuthInfo(java.lang.String userId,
android.content.Context context)
Get the BoxAuthenticationInfo for a given user.
|
BoxAuthentication.AuthStorage |
getAuthStorage()
Get the auth storage used to store auth information.
|
static BoxAuthentication |
getInstance()
Get singleton instance of the BoxAuthentication object.
|
java.lang.String |
getLastAuthenticatedUserId(android.content.Context context)
Get the user id that was last authenticated.
|
java.util.Map<java.lang.String,BoxAuthentication.BoxAuthenticationInfo> |
getStoredAuthInfo(android.content.Context context)
Get a map of all stored auth information.
|
void |
logout(BoxSession session)
Log out current BoxSession.
|
void |
logoutAllUsers(android.content.Context context)
Log out all users.
|
void |
onAuthenticated(BoxAuthentication.BoxAuthenticationInfo info,
android.content.Context context)
Callback method to be called when authentication process finishes.
|
void |
onAuthenticationFailure(BoxAuthentication.BoxAuthenticationInfo info,
java.lang.Exception ex)
Callback method to be called if authentication process fails.
|
void |
onLoggedOut(BoxAuthentication.BoxAuthenticationInfo info,
java.lang.Exception ex)
Callback method to be called on logout.
|
void |
refresh(BoxSession session)
Refresh the OAuth in the given BoxSession.
|
void |
setAuthStorage(BoxAuthentication.AuthStorage storage)
Set the storage to store auth information.
|
protected void |
startAuthenticateUI(BoxSession session,
boolean viaBoxApp)
Start authentication UI.
|
void |
startAuthenticationUI(BoxSession session) |
protected void |
startAuthenticationUsingBoxApp(BoxSession session)
Start box android app to authenticate.
|
public static final java.util.concurrent.ThreadPoolExecutor AUTH_EXECUTOR
public BoxAuthentication.BoxAuthenticationInfo getAuthInfo(java.lang.String userId, android.content.Context context)
public java.util.Map<java.lang.String,BoxAuthentication.BoxAuthenticationInfo> getStoredAuthInfo(android.content.Context context)
context - current context.public java.lang.String getLastAuthenticatedUserId(android.content.Context context)
context - current context.public static BoxAuthentication getInstance()
public void setAuthStorage(BoxAuthentication.AuthStorage storage)
public BoxAuthentication.AuthStorage getAuthStorage()
public void startAuthenticationUI(BoxSession session)
protected void startAuthenticationUsingBoxApp(BoxSession session)
public void onAuthenticated(BoxAuthentication.BoxAuthenticationInfo info, android.content.Context context)
public void onAuthenticationFailure(BoxAuthentication.BoxAuthenticationInfo info, java.lang.Exception ex)
public void onLoggedOut(BoxAuthentication.BoxAuthenticationInfo info, java.lang.Exception ex)
public void logout(BoxSession session) throws BoxException
BoxExceptionpublic void logoutAllUsers(android.content.Context context)
public void refresh(BoxSession session) throws BoxException
BoxExceptionpublic void addListener(BoxAuthentication.AuthListener listener)
protected void startAuthenticateUI(BoxSession session, boolean viaBoxApp)
viaBoxApp - true if you want to authenticate through installed box android app., otherwise use false.