public class LiveAuthClient
extends java.lang.Object
LiveAuthClient is a class responsible for retrieving a LiveConnectSession, which
provides authentication information for calls to Live APIs.| Constructor and Description |
|---|
LiveAuthClient(android.content.Context context,
java.lang.String clientId) |
LiveAuthClient(android.content.Context context,
java.lang.String clientId,
java.lang.Iterable<java.lang.String> scopes) |
LiveAuthClient(android.content.Context context,
java.lang.String clientId,
java.lang.Iterable<java.lang.String> scopes,
OAuthConfig oAuthConfig)
Constructs a new
LiveAuthClient instance and initializes its member variables. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getClientId() |
LiveConnectSession |
getSession() |
void |
login(android.app.Activity activity,
java.lang.Iterable<java.lang.String> scopes,
LiveAuthListener listener) |
void |
login(android.app.Activity activity,
java.lang.Iterable<java.lang.String> scopes,
java.lang.Object userState,
LiveAuthListener listener) |
void |
login(android.app.Activity activity,
java.lang.Iterable<java.lang.String> scopes,
java.lang.Object userState,
java.lang.String loginHint,
LiveAuthListener listener)
Logs in an user with the given scopes and additional saved state.
|
void |
login(android.app.Activity activity,
LiveAuthListener listener) |
java.lang.Boolean |
loginSilent(java.lang.Iterable<java.lang.String> scopes,
LiveAuthListener listener) |
java.lang.Boolean |
loginSilent(java.lang.Iterable<java.lang.String> scopes,
java.lang.Object userState,
LiveAuthListener listener)
Attempts to log in a user using multiple non-interactive approaches.
|
java.lang.Boolean |
loginSilent(LiveAuthListener listener) |
java.lang.Boolean |
loginSilent(java.lang.Object userState,
LiveAuthListener listener) |
void |
logout(LiveAuthListener listener)
Logs out the given user.
|
void |
logout(java.lang.Object userState,
LiveAuthListener listener)
Logs out the given user.
|
public LiveAuthClient(android.content.Context context,
java.lang.String clientId,
java.lang.Iterable<java.lang.String> scopes,
OAuthConfig oAuthConfig)
LiveAuthClient instance and initializes its member variables.context - Context of the Application used to save any refresh_token.clientId - The client_id of the Live Connect Application to login to.scopes - to initialize the LiveConnectSession with.
See MSDN Live Connect
Reference's Scopes and permissions for a list of scopes and explanations.public LiveAuthClient(android.content.Context context,
java.lang.String clientId)
public LiveAuthClient(android.content.Context context,
java.lang.String clientId,
java.lang.Iterable<java.lang.String> scopes)
public java.lang.String getClientId()
public void login(android.app.Activity activity,
LiveAuthListener listener)
public void login(android.app.Activity activity,
java.lang.Iterable<java.lang.String> scopes,
LiveAuthListener listener)
public void login(android.app.Activity activity,
java.lang.Iterable<java.lang.String> scopes,
java.lang.Object userState,
LiveAuthListener listener)
public void login(android.app.Activity activity,
java.lang.Iterable<java.lang.String> scopes,
java.lang.Object userState,
java.lang.String loginHint,
LiveAuthListener listener)
Dialog that will prompt the
user for a username and password, and ask for consent to use the given scopes.
A LiveConnectSession will be returned by calling
LiveAuthListener.onAuthComplete(LiveStatus, LiveConnectSession, Object).
Otherwise, the LiveAuthListener.onAuthError(LiveAuthException, Object) will be
called. These methods will be called on the main/UI thread.activity - Activity instance to display the Login dialog onscopes - to initialize the LiveConnectSession with.
See MSDN Live Connect
Reference's Scopes and permissions for a list of scopes and explanations.
Scopes specified here override scopes specified in the constructor.userState - arbitrary object that is used to determine the caller of the method.loginHint - the hint for the sign in experience to show the username pre-filled outlistener - called on either completion or error during the login process.java.lang.IllegalStateException - if there is a pending login request.public java.lang.Boolean loginSilent(LiveAuthListener listener)
public java.lang.Boolean loginSilent(java.lang.Iterable<java.lang.String> scopes,
LiveAuthListener listener)
public java.lang.Boolean loginSilent(java.lang.Object userState,
LiveAuthListener listener)
public java.lang.Boolean loginSilent(java.lang.Iterable<java.lang.String> scopes,
java.lang.Object userState,
LiveAuthListener listener)
LiveConnectSession will be returned by calling
LiveAuthListener.onAuthComplete(LiveStatus, LiveConnectSession, Object).
Otherwise, the LiveAuthListener.onAuthError(LiveAuthException, Object) will be
called. These methods will be called on the main/UI thread.scopes - list of scopes which will override scopes from constructoruserState - state object that is pass to listener on completion.listener - called on either completion or error during the login process.public void logout(LiveAuthListener listener)
LiveConnectSession.
LiveAuthListener.onAuthComplete(LiveStatus, LiveConnectSession, Object) will be
called on completion. Otherwise,
LiveAuthListener.onAuthError(LiveAuthException, Object) will be called.listener - called on either completion or error during the logout process.public void logout(java.lang.Object userState,
LiveAuthListener listener)
LiveConnectSession.
LiveAuthListener.onAuthComplete(LiveStatus, LiveConnectSession, Object) will be
called on completion. Otherwise,
LiveAuthListener.onAuthError(LiveAuthException, Object) will be called.userState - arbitrary object that is used to determine the caller of the method.listener - called on either completion or error during the logout process.public LiveConnectSession getSession()
LiveConnectSession instance that this LiveAuthClient created.