Share via


AppCredentials.GetTokenAsync(Boolean) Method

Definition

Gets an OAuth access token.

public System.Threading.Tasks.Task<string> GetTokenAsync (bool forceRefresh = false);
member this.GetTokenAsync : bool -> System.Threading.Tasks.Task<string>
Public Function GetTokenAsync (Optional forceRefresh As Boolean = false) As Task(Of String)

Parameters

forceRefresh
Boolean

True to force a refresh of the token; or false to get a cached token if it exists.

Returns

A task that represents the work queued to execute.

Remarks

If the task is successful, the result contains the access token string.

Applies to