AzureActiveDirectoryTokenProvider Class

  • java.lang.Object
    • TokenProvider
      • com.microsoft.azure.servicebus.security.AzureActiveDirectoryTokenProvider

public class AzureActiveDirectoryTokenProvider extends TokenProvider

This is a token provider that obtains tokens from Azure Active Directory. It supports multiple modes of authentication with active directory to obtain tokens.

Constructor Summary

Constructor Description
AzureActiveDirectoryTokenProvider(AuthenticationContext authenticationContext, AsymmetricKeyCredential asymmetricKeyCredential)

Creates a token provider that authenticates with active directory using certificate.

AzureActiveDirectoryTokenProvider(AuthenticationContext authenticationContext, ClientCredential clientCredential)

Creates a token provider that authenticates with active directory using client secret.

AzureActiveDirectoryTokenProvider(AuthenticationContext authenticationContext, String clientId, String userName, String password)

Creates a token provider that authenticates with active directory using username and password.

Method Summary

Modifier and Type Method and Description
CompletableFuture<SecurityToken> getSecurityTokenAsync(String audience)

Inherited Members

Constructor Details

AzureActiveDirectoryTokenProvider

public AzureActiveDirectoryTokenProvider(AuthenticationContext authenticationContext, AsymmetricKeyCredential asymmetricKeyCredential)

Creates a token provider that authenticates with active directory using certificate.

Parameters:

authenticationContext - Authentication context pointing to the instance of Azure Active Directory
asymmetricKeyCredential - Key credential containing the certificate to be used for authentication

AzureActiveDirectoryTokenProvider

public AzureActiveDirectoryTokenProvider(AuthenticationContext authenticationContext, ClientCredential clientCredential)

Creates a token provider that authenticates with active directory using client secret.

Parameters:

authenticationContext - Authentication context pointing to the instance of Azure Active Directory
clientCredential - Client credential containing client id and client secret of the application

AzureActiveDirectoryTokenProvider

public AzureActiveDirectoryTokenProvider(AuthenticationContext authenticationContext, String clientId, String userName, String password)

Creates a token provider that authenticates with active directory using username and password.

Parameters:

authenticationContext - Authentication context pointing to the instance of Azure Active Directory
clientId - client id of the application
userName - user name
password - password

Method Details

getSecurityTokenAsync

public CompletableFuture getSecurityTokenAsync(String audience)

Parameters:

audience

Applies to