com.microsoft.aad.adal
Class AuthenticationParameters

java.lang.Object
  extended by com.microsoft.aad.adal.AuthenticationParameters

public class AuthenticationParameters
extends Object

Matching to ADAL.NET It provides helper methods to get the authorization_endpoint from resource address.


Nested Class Summary
static interface AuthenticationParameters.AuthenticationParamCallback
          Callback to use for async request.
 
Field Summary
static String AUTH_HEADER_INVALID_FORMAT
          Invalid authentication header format.
static String AUTH_HEADER_MISSING
          WWW-Authenticate header was expected in the response.
static String AUTH_HEADER_MISSING_AUTHORITY
          WWW-Authenticate header is missing authorization_uri.
static String AUTH_HEADER_WRONG_STATUS
          Unauthorized http response (status code 401) was expected.
static String AUTHENTICATE_HEADER
          Constant Authenticate header: WWW-Authenticate.
static String AUTHORITY_KEY
          Constant Authority key.
static String BEARER
          Constant Bearer.
static String RESOURCE_KEY
          Constant Resource key.
 
Constructor Summary
AuthenticationParameters()
          Creates AuthenticationParameters.
 
Method Summary
static void createFromResourceUrl(android.content.Context context, URL resourceUrl, AuthenticationParameters.AuthenticationParamCallback callback)
          ADAL will make the call to get authority and resource info.
static AuthenticationParameters createFromResponseAuthenticateHeader(String authenticateHeader)
          ADAL will parse the header response to get the authority and the resource info.
 String getAuthority()
          get authority from the header.
 String getResource()
          get resource from the header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTH_HEADER_MISSING_AUTHORITY

public static final String AUTH_HEADER_MISSING_AUTHORITY
WWW-Authenticate header is missing authorization_uri.

See Also:
Constant Field Values

AUTH_HEADER_INVALID_FORMAT

public static final String AUTH_HEADER_INVALID_FORMAT
Invalid authentication header format.

See Also:
Constant Field Values

AUTH_HEADER_MISSING

public static final String AUTH_HEADER_MISSING
WWW-Authenticate header was expected in the response.

See Also:
Constant Field Values

AUTH_HEADER_WRONG_STATUS

public static final String AUTH_HEADER_WRONG_STATUS
Unauthorized http response (status code 401) was expected.

See Also:
Constant Field Values

AUTHENTICATE_HEADER

public static final String AUTHENTICATE_HEADER
Constant Authenticate header: WWW-Authenticate.

See Also:
Constant Field Values

BEARER

public static final String BEARER
Constant Bearer.

See Also:
Constant Field Values

AUTHORITY_KEY

public static final String AUTHORITY_KEY
Constant Authority key.

See Also:
Constant Field Values

RESOURCE_KEY

public static final String RESOURCE_KEY
Constant Resource key.

See Also:
Constant Field Values
Constructor Detail

AuthenticationParameters

public AuthenticationParameters()
Creates AuthenticationParameters.

Method Detail

getAuthority

public String getAuthority()
get authority from the header.

Returns:
Authority extracted from the header.

getResource

public String getResource()
get resource from the header.

Returns:
resource from the header.

createFromResourceUrl

public static void createFromResourceUrl(android.content.Context context,
                                         URL resourceUrl,
                                         AuthenticationParameters.AuthenticationParamCallback callback)
ADAL will make the call to get authority and resource info.

Parameters:
context - Context
resourceUrl - Url for resource to query for 401 response.
callback - AuthenticationParameters.AuthenticationParamCallback

createFromResponseAuthenticateHeader

public static AuthenticationParameters createFromResponseAuthenticateHeader(String authenticateHeader)
ADAL will parse the header response to get the authority and the resource info.

Parameters:
authenticateHeader - Header to check authority and resource.
Returns:
AuthenticationParameters


Copyright © 2003–2015. All rights reserved.