IPublicClientApplication Interface
public interface IPublicClientApplication
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
acquireToken(@NonNull final AcquireTokenParameters acquireTokenParameters)
Acquire token interactively, will pop-up webUI. Interactive flow will skip the cache lookup. Default value for Prompt is SELECT_ACCOUNT. Convey parameters via the AquireTokenParameters object |
void |
acquireToken(@NonNull final Activity activity, @NonNull final String[] scopes, @NonNull final AuthenticationCallback callback)
Acquire token interactively, will pop-up webUI. Interactive flow will skip the cache lookup. Default value for Prompt is SELECT_ACCOUNT. |
IAuthentication |
acquireTokenSilent(@NonNull final AcquireTokenSilentParameters acquireTokenSilentParameters)
Perform acquire token silent call. If there is a valid access token in the cache, the sdk will return the access token; If no valid access token exists, the sdk will try to find a refresh token and use the refresh token to get a new access token. If refresh token does not exist or it fails the refresh, exception will be sent back via callback. |
void |
acquireTokenSilentAsync(@NonNull final AcquireTokenSilentParameters acquireTokenSilentParameters)
Perform acquire token silent call. If there is a valid access token in the cache, the sdk will return the access token; If no valid access token exists, the sdk will try to find a refresh token and use the refresh token to get a new access token. If refresh token does not exist or it fails the refresh, exception will be sent back via callback. |
void |
acquireTokenWithDeviceCode(@NonNull String[] scopes, @NonNull final DeviceCodeFlowCallback callback)
Perform the Device Code Flow (DCF) protocol to allow a device without input capability to authenticate and get a new access token. Currently, flow is only supported in local MSAL. No Broker support. |
String |
generateSignedHttpRequest(@NonNull final IAccount account, @NonNull final PoPAuthenticationScheme popParameters)
Signs the provided PoPAuthenticationScheme parameters into a JWT on behalf of the provided IAccount. Important: Use of this API requires setting the minimum_required_broker_protocol_version to "6.0" or higher. |
void |
generateSignedHttpRequest(@NonNull final IAccount account, @NonNull final PoPAuthenticationScheme popParameters, @NonNull final SignedHttpRequestRequestCallback callback)
Signs the provided PoPAuthenticationScheme parameters into a JWT on behalf of the provided IAccount. Important: Use of this API requires setting the minimum_required_broker_protocol_version to "6.0" or higher. |
Public |
getConfiguration()
Returns the PublicClientConfiguration for this instance of PublicClientApplication. |
boolean |
isSharedDevice()
Returns whether the application is being run on a device that is marked as a shared. Only SingleAccountPublicClientApplications may be used on shared devices |
Method Details
acquireToken
public void acquireToken(@NonNull final AcquireTokenParameters acquireTokenParameters)
Acquire token interactively, will pop-up webUI. Interactive flow will skip the cache lookup. Default value for Prompt is SELECT_ACCOUNT.
Convey parameters via the AquireTokenParameters object
Parameters:
acquireToken
public void acquireToken(@NonNull final Activity activity, @NonNull final String[] scopes, @NonNull final AuthenticationCallback callback)
Acquire token interactively, will pop-up webUI. Interactive flow will skip the cache lookup. Default value for Prompt is SELECT_ACCOUNT.
Parameters:
acquireTokenSilent
public IAuthenticationResult acquireTokenSilent(@NonNull final AcquireTokenSilentParameters acquireTokenSilentParameters)
Perform acquire token silent call. If there is a valid access token in the cache, the sdk will return the access token; If no valid access token exists, the sdk will try to find a refresh token and use the refresh token to get a new access token. If refresh token does not exist or it fails the refresh, exception will be sent back via callback.
Parameters:
acquireTokenSilentAsync
public void acquireTokenSilentAsync(@NonNull final AcquireTokenSilentParameters acquireTokenSilentParameters)
Perform acquire token silent call. If there is a valid access token in the cache, the sdk will return the access token; If no valid access token exists, the sdk will try to find a refresh token and use the refresh token to get a new access token. If refresh token does not exist or it fails the refresh, exception will be sent back via callback.
Parameters:
acquireTokenWithDeviceCode
public void acquireTokenWithDeviceCode(@NonNull String[] scopes, @NonNull final DeviceCodeFlowCallback callback)
Perform the Device Code Flow (DCF) protocol to allow a device without input capability to authenticate and get a new access token. Currently, flow is only supported in local MSAL. No Broker support.
Parameters:
generateSignedHttpRequest
public String generateSignedHttpRequest(@NonNull final IAccount account, @NonNull final PoPAuthenticationScheme popParameters)
Signs the provided PoPAuthenticationScheme parameters into a JWT on behalf of the provided IAccount.
Important: Use of this API requires setting the minimum_required_broker_protocol_version to "6.0" or higher.
Parameters:
Returns:
generateSignedHttpRequest
public void generateSignedHttpRequest(@NonNull final IAccount account, @NonNull final PoPAuthenticationScheme popParameters, @NonNull final SignedHttpRequestRequestCallback callback)
Signs the provided PoPAuthenticationScheme parameters into a JWT on behalf of the provided IAccount.
Important: Use of this API requires setting the minimum_required_broker_protocol_version to "6.0" or higher.
Parameters:
getConfiguration
public PublicClientApplicationConfiguration getConfiguration()
Returns the PublicClientConfiguration for this instance of PublicClientApplication.
Returns:
isSharedDevice
public boolean isSharedDevice()
Returns whether the application is being run on a device that is marked as a shared. Only SingleAccountPublicClientApplications may be used on shared devices
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for