AuthenticationContext.AcquireTokenAsync Method (String, String, UserCredential)
Applies to: Version: 2.19.208020213, Platform: .NET Desktop.
Acquires security token from the authority.
Namespace: Microsoft.IdentityModel.Clients.ActiveDirectory
Assembly: Microsoft.IdentityModel.Clients.ActiveDirectory (in Microsoft.IdentityModel.Clients.ActiveDirectory.dll)
Syntax
public Task<AuthenticationResult> AcquireTokenAsync(
string resource,
string clientId,
UserCredential userCredential
)
Parameters
resource
Type: System.StringIdentifier of the target resource that is the recipient of the requested token.
clientId
Type: System.StringIdentifier of the client requesting the token.
userCredential
Type: Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredentialThe user credential to use for token acquisition.
Return Value
Type: System.Threading.Tasks.Task<AuthenticationResult>
It contains Access Token, Refresh Token and the Access Token's expiration time.
See Also
AcquireTokenAsync Overload
AuthenticationContext Class
Microsoft.IdentityModel.Clients.ActiveDirectory Namespace
Return to top