AuthenticationContextIntegratedAuthExtensions.AcquireTokenAsync(AuthenticationContext, String, String, UserCredential) Method

Definition

Acquires security token from the authority.

public static System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> AcquireTokenAsync (this Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext ctx, string resource, string clientId, Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential userCredential);
static member AcquireTokenAsync : Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext * string * string * Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential -> System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>

Parameters

ctx
AuthenticationContext

Authentication context instance

resource
System.String

Identifier of the target resource that is the recipient of the requested token.

clientId
System.String

Identifier of the client requesting the token.

userCredential
UserCredential

The user credential to use for token acquisition.

Returns

System.Threading.Tasks.Task<AuthenticationResult>

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

Remarks

This feature is supported only for Azure Active Directory and Active Directory Federation Services (ADFS) on Windows 10.

Applies to