AuthenticationException Class

  • java.lang.Object
    • Exception
      • com.microsoft.aad.adal.AuthenticationException

public class AuthenticationException

ADAL exception.

Constructor Summary

Constructor Description
AuthenticationException()

Default constructor for AuthenticationException.

AuthenticationException(ADALError code)

Constructs a new AuthenticationException with error code.

AuthenticationException(ADALError code, String details)
AuthenticationException(ADALError code, String details, HttpWebResponse response)
AuthenticationException(ADALError code, String details, HttpWebResponse response, Throwable throwable)
AuthenticationException(ADALError code, String details, Throwable throwable)

Method Summary

Modifier and Type Method and Description
ADALError getCode()

Gets ADALError code.

HashMap<String, String> getHttpResponseBody()

Gets the response body that may be returned by the service.

HashMap<String, List<String>> getHttpResponseHeaders()

Get the response headers that indicated an error.

String getLocalizedMessage(Context context)

Gets localized ADALError code if provided by context.

String getMessage()
int getServiceStatusCode()

Gets the status code returned from http layer.

Constructor Details

AuthenticationException

public AuthenticationException()

Default constructor for AuthenticationException.

AuthenticationException

public AuthenticationException(ADALError code)

Constructs a new AuthenticationException with error code.

Parameters:

code -

ADALError

AuthenticationException

public AuthenticationException(ADALError code, String details)

Parameters:

code - Resource file related error code. Message will be derived from resource with using app context
details - Details related to the error such as query string, request info

AuthenticationException

public AuthenticationException(ADALError code, String details, HttpWebResponse response)

Parameters:

code - Resource file related error code. Message will be derived from resource using app context
details - Details related to the error such as query string, request info.
response - HTTP web response

AuthenticationException

public AuthenticationException(ADALError code, String details, HttpWebResponse response, Throwable throwable)

Parameters:

code - Resource file related error code. Message will be derived from resource using app context
details - Details related to the error such as query string, request info.
response - HTTP web response
throwable -

Throwable

AuthenticationException

public AuthenticationException(ADALError code, String details, Throwable throwable)

Parameters:

code - Resource file related error code. Message will be derived from resource with using app context
details - Details related to the error such as query string, request info
throwable -

Throwable

Method Details

getCode

public ADALError getCode()

Gets ADALError code.

Returns:

ADALError code

getHttpResponseBody

public HashMap getHttpResponseBody()

Gets the response body that may be returned by the service.

Returns:

response body map, null if not initialized.

getHttpResponseHeaders

public HashMap> getHttpResponseHeaders()

Get the response headers that indicated an error.

Returns:

The response headers for the network call, null if not initialized.

getLocalizedMessage

public String getLocalizedMessage(Context context)

Gets localized ADALError code if provided by context.

Parameters:

context -

Context

Returns:

Error message

getMessage

public String getMessage()

getServiceStatusCode

public int getServiceStatusCode()

Gets the status code returned from http layer.

Returns:

status code from http layer. Return -1 if status code is not initialized.

Applies to