---
title: "Table 1140 OAuth 2.0 Setup"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/table/1140-oauth-2-0-setup/
type: table
id: 1140
name: "OAuth 2.0 Setup"
app: "Base Application"
namespace: System.Security.Authentication
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/table/1140-oauth-2-0-setup/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Table 1140 OAuth 2.0 Setup

Jonas Paprotka, https://jonas-paprotka.de/ref/table/1140-oauth-2-0-setup/

| | |
| --- | --- |
| App | Base Application |
| Namespace | System.Security.Authentication |
| Versions | 17-28 |
| Source file | System/OAuth/OAuth20Setup.Table.al |

## Fields

| Id | Name | Type | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| 1 | Code | Code[20] | 17-28 | - | - |
| 2 | Description | Text[250] | 17-28 | - | - |
| 3 | Service URL | Text[250] | 17-28 | - | - |
| 4 | Redirect URL | Text[250] | 17-28 | - | - |
| 5 | Client ID | Guid | 17-28 | - | - |
| 6 | Client Secret | Guid | 17-28 | - | - |
| 7 | Access Token | Guid | 17-28 | - | - |
| 8 | Refresh Token | Guid | 17-28 | - | - |
| 9 | Authorization URL Path | Text[250] | 17-28 | - | - |
| 10 | Access Token URL Path | Text[250] | 17-28 | - | - |
| 11 | Refresh Token URL Path | Text[250] | 17-28 | - | - |
| 12 | Scope | Text[250] | 17-28 | - | - |
| 13 | Authorization Response Type | Text[250] | 17-28 | - | - |
| 14 | Status | Option | 17-28 | - | - |
| 15 | Token DataScope | Option | 17-28 | - | - |
| 16 | Activity Log ID | Integer | 17-28 | - | - |
| 17 | Daily Limit | Integer | 17-28 | - | - |
| 18 | Daily Count | Integer | 17-28 | - | - |
| 19 | Latest Datetime | DateTime | 17-28 | - | - |
| 20 | Access Token Due DateTime | DateTime | 17-28 | - | - |
| 21 | Feature GUID | Guid | 19-28 | - | - |
| 22 | User ID | Code[50] | 19-28 | - | - |
| 50 | Code Challenge Method | Enum OAuth 2.0 Code Challenge | 23-28 | - | - |
| 51 | Code Verifier | Guid | 23-28 | - | - |
| 52 | Use Nonce | Boolean | 23-28 | - | - |

## Keys

| Name | Fields | Versions |
| --- | --- | --- |
| Key1, clustered | Code | 17-28 |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| SetToken | (var Guid, Text) | - | public | 17-26 | Pending 24.0 | Use SetToken with paramaters declared as SecretText instead. |
| GetToken | (Guid) | Text | public | 17-26 | Pending 24.0 | Use GetToken with paramaters declared as SecretText instead. |
| DeleteToken | (Guid) | - | internal | 17-28 | Pending 27.0 | This method is being marked as internal. Call IsolatedStorage.Delete from your app. |
| HasToken | (Guid) | Boolean | internal | 17-28 | Pending 27.0 | This method is being marked as internal. Call IsolatedStorage.Contains from your app. |
| GetTokenDataScope | () | DataScope | public | 17-28 | - | - |
| RequestAuthorizationCode | () | - | internal | 17-28 | Pending 27.0 | This method is being marked as internal. Get the Rec."Client ID" from IsolatedStorage, call OAuth20Mgt.GetAuthorizationURLAsSecretText with it, unwrap the result and make a hyperlink. |
| RequestAccessToken | (var Text, Text) | Boolean | internal | 17-28 | Pending 27.0 | This method is being marked as internal. Get the client credentials from IsolatedStorage using Rec."Client ID" and Rec."Client Secret", call OAuth20Mgt.RequestAccessToken or implement this yourself, then save the access token with IsolatedStorage.SetEncrypted or IsolatedStorage.Set. |
| RefreshAccessToken | (var Text) | Boolean | internal | 17-28 | Pending 27.0 | This method is being marked as internal. Get the refresh token with IsolatedStorage.Get(Rec."Refresh Token"), then call OAuth20Mgt.RefreshAccessToken with it and save the access token with IsolatedStorage.SetEncrypted or IsolatedStorage.Set. |
| InvokeRequest | (Text, var Text, var Text, Boolean) | Boolean | internal | 17-28 | Pending 27.0 | This method is being marked as internal. Implement your version of InvokeRequest by getting the Rec."Access Token" from IsolatedStorage, then calling public method OAuth20Mgt.InvokeRequest with it. If you set parameter RetryOnCredentialsFailure to true, you must also subscribe to event OnBeforeRefreshAccessToken raised by OAuth20Setup table and process it with your implementation of RefreshAccessToken and subscribe to OnBeforeInvokeRequest event raised by OAuth20Setup table and process it with your implementation of InvokeRequest (this implementation) |
| FindSetOAuth20SetupByFeature | (Guid) | Boolean | public | 19-28 | - | - |
| FindFirstOAuth20SetupByFeatureAndCurrUser | (Guid) | Boolean | public | 19-28 | - | - |
| FindFirstOAuth20SetupByFeatureAndUser | (Guid, Code[50]) | Boolean | public | 19-28 | - | - |
| SetToken | (var Guid, SecretText) | - | internal | 24-28 | Pending 27.0 | This method is being marked as internal. Call IsolatedStorage.SetEncrypted or IsolatedStorage.Set from your app. |
| GetTokenAsSecretText | (Guid) | SecretText | internal | 24-28 | Pending 27.0 | This method is being marked as internal. Call IsolatedStorage.Get from your app. |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterRequestAccessToken | (Record OAuth 2.0 Setup, Boolean, var Text) | 17-28 | - | - |
| Integration event | OnBeforeRequestAuthoizationCode | (Record OAuth 2.0 Setup, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeRefreshAccessToken | (var Record OAuth 2.0 Setup, var Boolean, var Text, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeRequestAccessToken | (var Record OAuth 2.0 Setup, Text, var Boolean, var Text, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeInvokeRequest | (var Record OAuth 2.0 Setup, Text, var Text, var Text, var Boolean, var Boolean, Boolean) | 17-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
