AuthenticationContext Class
- java.lang.Object
- com.microsoft.aad.adal4j.AuthenticationContext
public class AuthenticationContext
The main class representing the authority issuing tokens for resources. It provides several ways to request access token, namely via Authorization Code, Confidential Client and Client Certificate.
Constructor Summary
Constructor | Description |
---|---|
AuthenticationContext(final String authority, final boolean validateAuthority, final ExecutorService service) |
Constructor to create the context with the address of the authority. |
Method Summary
Constructor Details
AuthenticationContext
public AuthenticationContext(final String authority, final boolean validateAuthority, final ExecutorService service)
Constructor to create the context with the address of the authority.
Parameters:
Throws:
Method Details
acquireDeviceCode
public Future
Acquires a device code from the authority
Parameters:
Returns:
Throws:
acquireToken
public Future
Acquires security token from the authority.
Parameters:
Returns:
Throws:
acquireToken
public Future
Acquires security token from the authority.
Parameters:
Returns:
acquireToken
public Future
Acquires security token from the authority.
Parameters:
Returns:
acquireToken
public Future
Acquires a security token from the authority using a username/password flow.
Parameters:
Returns:
acquireToken
public Future
Acquires an access token from the authority on behalf of a user. It requires using a user token previously received. Uses certificate to authenticate client.
Parameters:
Returns:
Throws:
acquireToken
public Future
Acquires an access token from the authority on behalf of a user. It requires using a user token previously received.
Parameters:
Returns:
Throws:
acquireTokenByAuthorizationCode
public Future
Acquires security token from the authority using an authorization code previously received.
Parameters:
Returns:
acquireTokenByAuthorizationCode
public Future
Acquires security token from the authority using an authorization code previously received.
Parameters:
Returns:
Throws:
acquireTokenByAuthorizationCode
public Future
Acquires security token from the authority using an authorization code previously received.
Parameters:
Returns:
Throws:
acquireTokenByAuthorizationCode
public Future
Acquires security token from the authority using an authorization code previously received.
Parameters:
Returns:
acquireTokenByAuthorizationCode
public Future
Acquires security token from the authority using an authorization code previously received.
Parameters:
Returns:
acquireTokenByAuthorizationCode
public Future
Acquires security token from the authority using an authorization code previously received.
Parameters:
Returns:
acquireTokenByAuthorizationCode
public Future
Acquires security token from the authority using an authorization code previously received.
Parameters:
Returns:
acquireTokenByDeviceCode
public Future
Acquires security token from the authority using an device code previously received.
Parameters:
Returns:
Throws:
acquireTokenByRefreshToken
public Future
Acquires a security token from the authority using a Refresh Token previously received.
Parameters:
Returns:
Throws:
acquireTokenByRefreshToken
public Future
Acquires a security token from the authority using a Refresh Token previously received.
Parameters:
Returns:
Throws:
acquireTokenByRefreshToken
public Future
Acquires a security token from the authority using a Refresh Token previously received.
Parameters:
Returns:
acquireTokenByRefreshToken
public Future
Acquires a security token from the authority using a Refresh Token previously received.
Parameters:
Returns:
acquireTokenByRefreshToken
public Future
Acquires a security token from the authority using a Refresh Token previously received. This method is suitable for the daemon OAuth2 flow when a client secret is not possible.
Parameters:
Returns:
Throws:
acquireTokenByRefreshToken
public Future
Acquires a security token from the authority using a Refresh Token previously received.
Parameters:
Returns:
acquireTokenByRefreshToken
public Future
Acquires a security token from the authority using a Refresh Token previously received.
Parameters:
Returns:
acquireTokenByRefreshToken
public Future
Acquires a security token from the authority using a Refresh Token previously received. This method is suitable for the daemon OAuth2 flow when a client secret is not possible.
Parameters:
Returns:
Throws:
getAuthority
public String getAuthority()
Authority associated with the context instance
Returns:
getCorrelationId
public String getCorrelationId()
Returns the correlation id configured by the user. It does not return the id automatically generated by the API in case the user does not provide one.
Returns:
getProxy
public Proxy getProxy()
Returns Proxy configuration
Returns:
getSslSocketFactory
public SSLSocketFactory getSslSocketFactory()
Returns SSLSocketFactory configuration object.
Returns:
isLogPii
public boolean isLogPii()
Returns logPii - boolean value, which determines whether Pii (personally identifiable information) will be logged in
Returns:
setCorrelationId
public void setCorrelationId(final String correlationId)
Set optional correlation id to be used by the API. If not provided, the API generates a random id.
Parameters:
setLogPii
public void setLogPii(boolean logPii)
Set logPii - boolean value, which determines whether Pii (personally identifiable information) will be logged in
Parameters:
setProxy
public void setProxy(Proxy proxy)
Sets Proxy configuration to be used by the context for all network communication. Default is null and system defined properties if any, would be used.
Parameters:
setSslSocketFactory
public void setSslSocketFactory(SSLSocketFactory sslSocketFactory)
Sets SSLSocketFactory object to be used by the context.
Parameters:
shouldValidateAuthority
public boolean shouldValidateAuthority()
Returns validateAuthority boolean value passed as a constructor parameter.
Returns: