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 code returned by the service after user authentication. Required only for 'Web' authentication mode to retrieve the access token. Obtained from the URL provided by GetOAuthAuthorizationUrl. |
| CallbackUrl | String | False | The endpoint URL to which the user will be redirected after completing the authorization process. Ensure this matches the URL registered with the service. |
| State | String | False | An optional value your application sends to maintain state between the request and callback. Useful for ensuring the response is tied to a specific request, mitigating CSRF attacks, or handling user navigation on your site. |
| Prompt | String | False | Determines the behavior of the authentication prompt. Options include 'select_account' (prompt the user to select an account), 'None' (no prompt), 'login' (force credential entry), or 'consent' (display permission grant dialog). |
Result Set Columns
| Name | Type | Description |
| OAuthAccessToken | String | The OAuth Access Token required for making authorized API requests on behalf of the user or application. |
| OAuthRefreshToken | String | A token used to obtain a new access token without requiring user re-authentication. |
| ExpiresIn | Long | The duration in seconds until the access token expires, after which a new token must be requested. |