Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

InteractiveBrowserCredential Class

Definition

Namespace:
Azure.Identity
Assemblies:
Azure.Core.dll, Azure.Identity.dll
Assembly:
Azure.Identity.dll
Packages:
Azure.Core v1.58.0, Azure.Identity v1.17.2
Package:
Azure.Identity v1.18.0-beta.3
Source:
InteractiveBrowserCredential.cs
Source:
InteractiveBrowserCredential.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

A TokenCredential implementation which launches the system default browser to interactively authenticate a user and obtain an access token. The browser will only be launched to authenticate the user once, then will silently acquire access tokens through the user's refresh token as long as it's valid. For usage instructions, see Interactive browser authentication.

public class InteractiveBrowserCredential : Azure.Core.TokenCredential
type InteractiveBrowserCredential = class
 inherit TokenCredential
Public Class InteractiveBrowserCredential
Inherits TokenCredential
Inheritance
InteractiveBrowserCredential
Derived

Remarks

Implements the OAuth 2.0 authorization code flow.

Constructors

Name Description
InteractiveBrowserCredential()

Creates a new InteractiveBrowserCredential with the specified options, which will authenticate users.

InteractiveBrowserCredential(InteractiveBrowserCredentialOptions)

Creates a new InteractiveBrowserCredential with the specified options, which will authenticate users with the specified application.

Methods

Name Description
Authenticate(CancellationToken)

Interactively authenticates a user via the default browser.

Authenticate(TokenRequestContext, CancellationToken)

Interactively authenticates a user via the default browser. The resulting AuthenticationRecord will automatically be used in subsequent calls to GetToken(TokenRequestContext, CancellationToken).

AuthenticateAsync(CancellationToken)

Interactively authenticates a user via the default browser. The resulting AuthenticationRecord will automatically be used in subsequent calls to GetTokenAsync(TokenRequestContext, CancellationToken).

AuthenticateAsync(TokenRequestContext, CancellationToken)

Interactively authenticates a user via the default browser.

CreateTokenOptions(IReadOnlyDictionary<String,Object>)

Creates a new instance of GetTokenOptions using the provided properties.

(Inherited from TokenCredential)
GetToken(GetTokenOptions, CancellationToken)

Gets an AuthenticationToken for the provided properties.

(Inherited from TokenCredential)
GetToken(TokenRequestContext, CancellationToken)

Silently obtains an AccessToken for a user account if the user has already authenticated. Otherwise, the default browser is launched to authenticate the user. Acquired tokens are cached by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness.

GetTokenAsync(GetTokenOptions, CancellationToken)

Gets an AuthenticationToken for the provided properties.

(Inherited from TokenCredential)
GetTokenAsync(TokenRequestContext, CancellationToken)

Silently obtains an AccessToken for a user account if the user has already authenticated. Otherwise, the default browser is launched to authenticate the user. Acquired tokens are cached by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness.

Applies to


Feedback

Was this page helpful?