AuthenticationContext.AcquireTokenByAuthorizationCodeAsync Method

Definition

Overloads

AcquireTokenByAuthorizationCodeAsync(String, Uri, ClientCredential, String)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

AcquireTokenByAuthorizationCodeAsync(String, Uri, IClientAssertionCertificate, String)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

AcquireTokenByAuthorizationCodeAsync(String, Uri, ClientAssertion, String)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

AcquireTokenByAuthorizationCodeAsync(String, Uri, ClientCredential)

Acquires security token from the authority using authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

AcquireTokenByAuthorizationCodeAsync(String, Uri, ClientAssertion)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

AcquireTokenByAuthorizationCodeAsync(String, Uri, IClientAssertionCertificate)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

AcquireTokenByAuthorizationCodeAsync(String, Uri, ClientCredential, String)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

public System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> AcquireTokenByAuthorizationCodeAsync (string authorizationCode, Uri redirectUri, Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential clientCredential, string resource);
member this.AcquireTokenByAuthorizationCodeAsync : string * Uri * Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential * string -> System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>

Parameters

authorizationCode
System.String

The authorization code received from service authorization endpoint.

redirectUri
System.Uri

Address to return to upon receiving a response from the authority.

clientCredential
ClientCredential

The credential to use for token acquisition.

resource
System.String

Identifier of the target resource that is the recipient of the requested token. It can be null if provided earlier to acquire authorizationCode.

Returns

System.Threading.Tasks.Task<AuthenticationResult>

It contains Access Token, its expiration time, user information.

Applies to

AcquireTokenByAuthorizationCodeAsync(String, Uri, IClientAssertionCertificate, String)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

public System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> AcquireTokenByAuthorizationCodeAsync (string authorizationCode, Uri redirectUri, Microsoft.IdentityModel.Clients.ActiveDirectory.IClientAssertionCertificate clientCertificate, string resource);
member this.AcquireTokenByAuthorizationCodeAsync : string * Uri * Microsoft.IdentityModel.Clients.ActiveDirectory.IClientAssertionCertificate * string -> System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>
Public Function AcquireTokenByAuthorizationCodeAsync (authorizationCode As String, redirectUri As Uri, clientCertificate As IClientAssertionCertificate, resource As String) As Task(Of AuthenticationResult)

Parameters

authorizationCode
System.String

The authorization code received from service authorization endpoint.

redirectUri
System.Uri

The redirect address used for obtaining authorization code.

clientCertificate
IClientAssertionCertificate

The client certificate to use for token acquisition.

resource
System.String

Identifier of the target resource that is the recipient of the requested token. It can be null if provided earlier to acquire authorizationCode.

Returns

System.Threading.Tasks.Task<AuthenticationResult>

It contains Access Token, its expiration time, user information.

Applies to

AcquireTokenByAuthorizationCodeAsync(String, Uri, ClientAssertion, String)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

public System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> AcquireTokenByAuthorizationCodeAsync (string authorizationCode, Uri redirectUri, Microsoft.IdentityModel.Clients.ActiveDirectory.ClientAssertion clientAssertion, string resource);
member this.AcquireTokenByAuthorizationCodeAsync : string * Uri * Microsoft.IdentityModel.Clients.ActiveDirectory.ClientAssertion * string -> System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>

Parameters

authorizationCode
System.String

The authorization code received from service authorization endpoint.

redirectUri
System.Uri

The redirect address used for obtaining authorization code.

clientAssertion
ClientAssertion

The client assertion to use for token acquisition.

resource
System.String

Identifier of the target resource that is the recipient of the requested token. It can be null if provided earlier to acquire authorizationCode.

Returns

System.Threading.Tasks.Task<AuthenticationResult>

It contains Access Token, its expiration time, user information.

Applies to

AcquireTokenByAuthorizationCodeAsync(String, Uri, ClientCredential)

Acquires security token from the authority using authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

public System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> AcquireTokenByAuthorizationCodeAsync (string authorizationCode, Uri redirectUri, Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential clientCredential);
member this.AcquireTokenByAuthorizationCodeAsync : string * Uri * Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential -> System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>

Parameters

authorizationCode
System.String

The authorization code received from service authorization endpoint.

redirectUri
System.Uri

Address to return to upon receiving a response from the authority.

clientCredential
ClientCredential

The credential to use for token acquisition.

Returns

System.Threading.Tasks.Task<AuthenticationResult>

It contains Access Token, its expiration time, user information.

Applies to

AcquireTokenByAuthorizationCodeAsync(String, Uri, ClientAssertion)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

public System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> AcquireTokenByAuthorizationCodeAsync (string authorizationCode, Uri redirectUri, Microsoft.IdentityModel.Clients.ActiveDirectory.ClientAssertion clientAssertion);
member this.AcquireTokenByAuthorizationCodeAsync : string * Uri * Microsoft.IdentityModel.Clients.ActiveDirectory.ClientAssertion -> System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>

Parameters

authorizationCode
System.String

The authorization code received from service authorization endpoint.

redirectUri
System.Uri

The redirect address used for obtaining authorization code.

clientAssertion
ClientAssertion

The client assertion to use for token acquisition.

Returns

System.Threading.Tasks.Task<AuthenticationResult>

It contains Access Token, its expiration time, user information.

Applies to

AcquireTokenByAuthorizationCodeAsync(String, Uri, IClientAssertionCertificate)

Acquires security token from the authority using an authorization code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

public System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> AcquireTokenByAuthorizationCodeAsync (string authorizationCode, Uri redirectUri, Microsoft.IdentityModel.Clients.ActiveDirectory.IClientAssertionCertificate clientCertificate);
member this.AcquireTokenByAuthorizationCodeAsync : string * Uri * Microsoft.IdentityModel.Clients.ActiveDirectory.IClientAssertionCertificate -> System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>
Public Function AcquireTokenByAuthorizationCodeAsync (authorizationCode As String, redirectUri As Uri, clientCertificate As IClientAssertionCertificate) As Task(Of AuthenticationResult)

Parameters

authorizationCode
System.String

The authorization code received from service authorization endpoint.

redirectUri
System.Uri

The redirect address used for obtaining authorization code.

clientCertificate
IClientAssertionCertificate

The client certificate to use for token acquisition.

Returns

System.Threading.Tasks.Task<AuthenticationResult>

It contains Access Token, its expiration time, user information.

Applies to