|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.microsoft.aad.adal.AuthenticationContext
public class AuthenticationContext
ADAL context to get access token, refresh token, and lookup from cache.
| Constructor Summary | |
|---|---|
AuthenticationContext(android.content.Context appContext,
String authority,
boolean validateAuthority)
Constructs context to use with known authority to get the token. |
|
AuthenticationContext(android.content.Context appContext,
String authority,
boolean validateAuthority,
ITokenCacheStore tokenCacheStore)
Constructs context to use with known authority to get the token. |
|
AuthenticationContext(android.content.Context appContext,
String authority,
ITokenCacheStore tokenCacheStore)
It will verify the authority and use the given cache. |
|
| Method Summary | |
|---|---|
void |
acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
PromptBehavior prompt,
AuthenticationCallback<AuthenticationResult> callback)
acquire Token will start interactive flow if needed. |
void |
acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
PromptBehavior prompt,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
acquire Token will start interactive flow if needed. |
void |
acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
String loginHint,
AuthenticationCallback<AuthenticationResult> callback)
acquire Token will start interactive flow if needed. |
void |
acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
String loginHint,
PromptBehavior prompt,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
acquire Token will start interactive flow if needed. |
void |
acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
String loginHint,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
acquire Token will start interactive flow if needed. |
void |
acquireToken(IWindowComponent fragment,
String resource,
String clientId,
String redirectUri,
String loginHint,
PromptBehavior prompt,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
It will start interactive flow if needed. |
void |
acquireToken(String resource,
String clientId,
String redirectUri,
String loginHint,
PromptBehavior prompt,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
This uses new dialog based prompt. |
void |
acquireTokenByRefreshToken(String refreshToken,
String clientId,
AuthenticationCallback<AuthenticationResult> callback)
acquire token using refresh token if cache is not used. |
void |
acquireTokenByRefreshToken(String refreshToken,
String clientId,
String resource,
AuthenticationCallback<AuthenticationResult> callback)
acquire token using refresh token if cache is not used. |
Future<AuthenticationResult> |
acquireTokenSilent(String resource,
String clientId,
String userId,
AuthenticationCallback<AuthenticationResult> callback)
The function will first look at the cache and automatically checks for the token expiration. |
AuthenticationResult |
acquireTokenSilentSync(String resource,
String clientId,
String userId)
This is sync function. |
boolean |
cancelAuthenticationActivity(int requestId)
Active authentication activity can be cancelled if it exists. |
String |
getAuthority()
Gets authority that is used for this object of AuthenticationContext. |
String |
getBrokerUser()
Gets username for current broker user. |
UserInfo[] |
getBrokerUsers()
|
ITokenCacheStore |
getCache()
Returns referenced cache. |
String |
getRedirectUriForBroker()
Get expected redirect Uri for your app to use in broker. |
UUID |
getRequestCorrelationId()
Get the CorrelationId set by user. |
boolean |
getValidateAuthority()
|
static String |
getVersionName()
Version name for ADAL not for the app itself. |
protected boolean |
isRefreshable(AuthenticationResult cachedItem)
|
void |
onActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
This method wraps the implementation for onActivityResult at the related Activity class. |
void |
setRequestCorrelationId(UUID requestCorrelationId)
set CorrelationId to requests. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuthenticationContext(android.content.Context appContext,
String authority,
boolean validateAuthority)
throws NoSuchAlgorithmException,
NoSuchPaddingException
appContext - It needs to have handle to the Context to use
the SharedPreferences as a Default cache storage. It does not
need to be activity.authority - Authority url to send code and token requestsvalidateAuthority - validate authority before sending token request
NoSuchPaddingException - Algorithm padding does not exist in the
device
NoSuchAlgorithmException - Encryption Algorithm does not exist in
the device. Please see the log record for details.
public AuthenticationContext(android.content.Context appContext,
String authority,
boolean validateAuthority,
ITokenCacheStore tokenCacheStore)
appContext - Contextauthority - Authority UrlvalidateAuthority - true/false for validationtokenCacheStore - Set to null if you don't want cache.
public AuthenticationContext(android.content.Context appContext,
String authority,
ITokenCacheStore tokenCacheStore)
appContext - Contextauthority - Authority UrltokenCacheStore - Cache ITokenCacheStore used to store
tokens. Set to null if you don't want cache.| Method Detail |
|---|
public ITokenCacheStore getCache()
public String getAuthority()
public boolean getValidateAuthority()
public String getBrokerUser()
public UserInfo[] getBrokerUsers()
throws android.accounts.OperationCanceledException,
android.accounts.AuthenticatorException,
IOException
android.accounts.OperationCanceledException
android.accounts.AuthenticatorException
IOExceptionpublic String getRedirectUriForBroker()
public void acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
String loginHint,
AuthenticationCallback<AuthenticationResult> callback)
activity - required to launch authentication activity.resource - required resource identifier.clientId - required client identifierredirectUri - Optional. It will use package name info if not
provided.loginHint - Optional login hintcallback - required
public void acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
String loginHint,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
activity - Calling activityresource - required resource identifier.clientId - required client identifierredirectUri - Optional. It will use packagename and provided suffix
for this.loginHint - Optional. This parameter will be used to pre-populate
the username field in the authentication form. Please note
that the end user can still edit the username field and
authenticate as a different user. This parameter can be null.extraQueryParameters - Optional. This parameter will be appended as
is to the query string in the HTTP authentication request to
the authority. The parameter can be null.callback - required AuthenticationCallback object for async
call.
public void acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
PromptBehavior prompt,
AuthenticationCallback<AuthenticationResult> callback)
PromptBehavior is AUTO, it will remove this
refresh token from cache and fall back on the UI. Default is AUTO. if
PromptBehavior is Always, it will display prompt screen.
activity - Calling activityresource - required resource identifier.clientId - required client identifier.redirectUri - Optional. It will use packagename and provided suffix
for this.prompt - Optional. PromptBehavior added as query parameter
to authorization urlcallback - required AuthenticationCallback object for async
call.
public void acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
PromptBehavior prompt,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
activity - Calling activityresource - required resource identifier.clientId - required client identifier.redirectUri - Optional. It will use packagename and provided suffix
for this.prompt - Optional. added as query parameter to authorization urlextraQueryParameters - Optional. added to authorization urlcallback - required AuthenticationCallback object for async
call.
public void acquireToken(android.app.Activity activity,
String resource,
String clientId,
String redirectUri,
String loginHint,
PromptBehavior prompt,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
activity - Calling activityresource - required resource identifier.clientId - required client identifier.redirectUri - Optional. It will use packagename and provided suffix
for this.loginHint - Optional. It is used for cache and as a loginhint at
authentication.prompt - Optional. added as query parameter to authorization urlextraQueryParameters - Optional. added to authorization urlcallback - required AuthenticationCallback object for async
call.
public void acquireToken(IWindowComponent fragment,
String resource,
String clientId,
String redirectUri,
String loginHint,
PromptBehavior prompt,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
fragment - It accepts both type of fragments.resource - required resource identifier.clientId - required client identifier.redirectUri - Optional. It will use packagename and provided suffix
for this.loginHint - Optional. It is used for cache and as a loginhint at
authentication.prompt - Optional. added as query parameter to authorization urlextraQueryParameters - Optional. added to authorization urlcallback - required AuthenticationCallback object for async
call.
public void acquireToken(String resource,
String clientId,
String redirectUri,
String loginHint,
PromptBehavior prompt,
String extraQueryParameters,
AuthenticationCallback<AuthenticationResult> callback)
resource - required resource identifier.clientId - required client identifier.redirectUri - Optional. It will use packagename and provided suffix
for this.loginHint - Optional. It is used for cache and as a loginhint at
authentication.prompt - Optional. added as query parameter to authorization urlextraQueryParameters - Optional. added to authorization urlcallback - required AuthenticationCallback object for async
call.
public AuthenticationResult acquireTokenSilentSync(String resource,
String clientId,
String userId)
resource - required resource identifier.clientId - required client identifier.userId - UserID obtained from
#getUserInfo()
Future object representing the
AuthenticationResult of the call. It contains Access
Token,the Access Token's expiration time, Refresh token, and
UserInfo.
public Future<AuthenticationResult> acquireTokenSilent(String resource,
String clientId,
String userId,
AuthenticationCallback<AuthenticationResult> callback)
resource - required resource identifier.clientId - required client identifier.userId - UserId obtained from UserInfo inside
AuthenticationResultcallback - required AuthenticationCallback object for async
call.
Future object representing the
AuthenticationResult of the call. It contains Access
Token,the Access Token's expiration time, Refresh token, and
UserInfo.
public void acquireTokenByRefreshToken(String refreshToken,
String clientId,
AuthenticationCallback<AuthenticationResult> callback)
refreshToken - Required.clientId - Required.callback - Required
public void acquireTokenByRefreshToken(String refreshToken,
String clientId,
String resource,
AuthenticationCallback<AuthenticationResult> callback)
refreshToken - Required.clientId - Required.resource - Required resource identifier.callback - Required
public void onActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
requestCode - Request code provided at the start of the activity.resultCode - Result code set from the activity.data - Intentpublic boolean cancelAuthenticationActivity(int requestId)
requestId - Hash code value of your callback to cancel activity
launch
protected boolean isRefreshable(AuthenticationResult cachedItem)
public UUID getRequestCorrelationId()
public void setRequestCorrelationId(UUID requestCorrelationId)
mRequestCorrelationId - public static String getVersionName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||