AuthenticationContext.AcquireToken Method (String, String, Uri, PromptBehavior)
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 AuthenticationResult AcquireToken(
string resource,
string clientId,
Uri redirectUri,
PromptBehavior promptBehavior
)
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.
redirectUri
Type: System.UriAddress to return to upon receiving a response from the authority.
promptBehavior
Type: Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehaviorIf Always, asks service to show user the authentication page which gives them chance to authenticate as a different user.
Return Value
Type: Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult
It contains Access Token, Refresh Token and the Access Token's expiration time.
See Also
AcquireToken Overload
AuthenticationContext Class
Microsoft.IdentityModel.Clients.ActiveDirectory Namespace
Return to top