AuthenticationResultExtensions.GetRefreshToken(AuthenticationResult) Method
Definition
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.
Returns the refresh token from the authentication result, if available. This is intended for advanced scenarios where the caller manages its own token cache, for example when using DisableInternalCacheOptions.
public static string GetRefreshToken(this Microsoft.Identity.Client.AuthenticationResult result);
static member GetRefreshToken : Microsoft.Identity.Client.AuthenticationResult -> string
<Extension()>
Public Function GetRefreshToken (result As AuthenticationResult) As String
Parameters
- result
- AuthenticationResult
The authentication result.
Returns
The refresh token string associated with the result for confidential client flows, if available.
This may be a refresh token returned in the token response or a refresh token used for the
acquisition and carried on the result; null otherwise. Refresh tokens are not exposed
for public client flows, client credentials, managed identity, or when the token was
served from cache. For the normal (non-long-running) On-Behalf-Of flow, MSAL intentionally
clears the refresh token, so this method will also return null.
Remarks
Refresh tokens are long-lived credentials. Store them securely and never expose them to end users or untrusted code.