AuthenticationContext.AcquireTokenSilentAsync Method (String, ClientAssertionCertificate, UserIdentifier)

 

Applies to: Version: 2.19.208020213, Platform: .NET Desktop.

Acquires security token without asking for user credential.

Namespace:   Microsoft.IdentityModel.Clients.ActiveDirectory
Assembly:  Microsoft.IdentityModel.Clients.ActiveDirectory (in Microsoft.IdentityModel.Clients.ActiveDirectory.dll)

public Task<AuthenticationResult> AcquireTokenSilentAsync(
	string resource,
	ClientAssertionCertificate clientCertificate,
	UserIdentifier userId
)

Parameters

resource
Type: System.String

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

clientCertificate
Type: Microsoft.IdentityModel.Clients.ActiveDirectory.ClientAssertionCertificate

The client certificate to use for token acquisition.

userId
Type: Microsoft.IdentityModel.Clients.ActiveDirectory.UserIdentifier

Identifier of the user token is requested for. This parameter can be UserIdentifier.Any.

Return Value

Type: System.Threading.Tasks.Task<AuthenticationResult>

It contains Access Token, Refresh Token and the Access Token's expiration time. If acquiring token without user credential is not possible, the method throws AdalException.

Return to top
Show: