public class BoxAuthentication
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
BoxAuthentication.AuthenticationRefreshProvider
An interface that should be implemented if using a custom authentication scheme and not the default oauth 2 based token refresh logic.
|
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.
|
| 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.Set<BoxAuthentication.AuthListener> |
getListeners() |
java.util.Map<java.lang.String,BoxAuthentication.BoxAuthenticationInfo> |
getStoredAuthInfo(android.content.Context context)
Get a map of all stored auth information.
|
static boolean |
isBoxAuthAppAvailable(android.content.Context context)
A check to see if an official box application supporting third party authentication is available.
|
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.
|
java.util.concurrent.FutureTask<BoxAuthentication.BoxAuthenticationInfo> |
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)
Start authentication UI.
|
void |
startAuthenticationUI(BoxSession session) |
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)
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 java.util.Set<BoxAuthentication.AuthListener> getListeners()
public void logout(BoxSession session)
public void logoutAllUsers(android.content.Context context)
public java.util.concurrent.FutureTask<BoxAuthentication.BoxAuthenticationInfo> refresh(BoxSession session) throws BoxException
BoxExceptionpublic void addListener(BoxAuthentication.AuthListener listener)
protected void startAuthenticateUI(BoxSession session)
session - the session to authenticate.public static boolean isBoxAuthAppAvailable(android.content.Context context)
context - current context