GetOAuthAccessToken
Fetches the OAuth Access Token, which is used to authenticate and authorize API calls made to Microsoft Dataverse.
Input
| Name | Type | Required | Description |
| AuthMode | String | False | Specifies the authentication method to use. Set to 'App' for a desktop or server-side application, or 'Web' for client-side or browser-based applications.
The default value is APP. |
| Verifier | String | False | The unique verifier code provided by the service after user authorization. This code is required to exchange for an access token when using 'Web' authentication mode. Obtain it by navigating to the URL returned by GetOAuthAuthorizationUrl. |
| CallbackUrl | String | False | The endpoint URL to which the user will be redirected after authorizing the application. Ensure this matches the URL registered with the OAuth provider. |
| State | String | False | An optional parameter used to maintain application state between the request and callback. It is sent to the OAuth server and returned in the response. Useful for CSRF mitigation, user-specific routing, or managing session state. |
| Prompt | String | False | Defines the behavior of the user authentication prompt. Options include 'select_account' (prompt to choose an account), 'None' (no prompt), 'login' (force credential entry), or 'consent' (request user consent for permissions). |
Result Set Columns
| Name | Type | Description |
| OAuthAccessToken | String | The OAuth Access Token returned by the OAuth service, used to make authorized API requests on behalf of the user or application. |
| ExpiresIn | Long | The remaining time in seconds until the access token expires. After expiration, a new token must be requested. |
| OAuthRefreshToken | String | A token used to refresh the access token without requiring user reauthentication. |