AuthenticationParameters Class

  • java.lang.Object
    • com.microsoft.aad.adal.AuthenticationParameters

public class AuthenticationParameters

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

Field Summary

Modifier and Type Field and Description
final String AUTH_HEADER_INVALID_FORMAT

Invalid authentication header format.

final String AUTH_HEADER_MISSING

WWW-Authenticate header was expected in the response.

final String AUTH_HEADER_MISSING_AUTHORITY

WWW-Authenticate header is missing authorization_uri.

final String AUTH_HEADER_WRONG_STATUS

Unauthorized http response (status code 401) was expected.

final String AUTHENTICATE_HEADER

Constant Authenticate header: WWW-Authenticate.

final String AUTHORITY_KEY

Constant Authority key.

final String BEARER

Constant Bearer.

final String RESOURCE_KEY

Constant Resource key.

Constructor Summary

Constructor Description
AuthenticationParameters()

Creates AuthenticationParameters.

Method Summary

Modifier and Type Method and Description
void createFromResourceUrl(Context context, final URL resourceUrl, final AuthenticationParamCallback callback)

ADAL will make the call to get authority and resource info.

AuthenticationParameters createFromResponseAuthenticateHeader(final 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.

Field Details

AUTH_HEADER_INVALID_FORMAT

public static final String AUTH_HEADER_INVALID_FORMAT= "Invalid authentication header format"

Invalid authentication header format.

AUTH_HEADER_MISSING

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

WWW-Authenticate header was expected in the response.

AUTH_HEADER_MISSING_AUTHORITY

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

WWW-Authenticate header is missing authorization_uri.

AUTH_HEADER_WRONG_STATUS

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

Unauthorized http response (status code 401) was expected.

AUTHENTICATE_HEADER

public static final String AUTHENTICATE_HEADER= "WWW-Authenticate"

Constant Authenticate header: WWW-Authenticate.

AUTHORITY_KEY

public static final String AUTHORITY_KEY= "authorization_uri"

Constant Authority key.

BEARER

public static final String BEARER= "bearer"

Constant Bearer.

RESOURCE_KEY

public static final String RESOURCE_KEY= "resource_id"

Constant Resource key.

Constructor Details

AuthenticationParameters

public AuthenticationParameters()

Creates AuthenticationParameters.

Method Details

createFromResourceUrl

public static void createFromResourceUrl(Context context, final URL resourceUrl, final 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.

createFromResponseAuthenticateHeader

public static AuthenticationParameters createFromResponseAuthenticateHeader(final 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:

Throws:

{

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.

Applies to