---
title: "Codeunit 6303 Azure AD Auth Flow"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/6303-azure-ad-auth-flow/
type: codeunit
id: 6303
name: "Azure AD Auth Flow"
app: "Base Application"
namespace: System.Azure.Identity
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/6303-azure-ad-auth-flow/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 6303 Azure AD Auth Flow

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/6303-azure-ad-auth-flow/

| | |
| --- | --- |
| App | Base Application |
| Namespace | System.Azure.Identity |
| Versions | 17-28 |
| Source file | Modules/System/AzureADAuthentication/AzureADAuthFlow.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| CanHandle | () | Boolean | public | 17-28 | - | - |
| Initialize | (Text) | - | public | 17-28 | - | - |
| AcquireTokenByAuthorizationCode | (Text, Text) | Text | public | 17-27 | Pending 25.0 | Replaced by AcquireTokenByAuthorizationCodeAsSecretText |
| AcquireTokenByAuthorizationCodeWithCredentials | (Text, Text, Text, Text) | Text | public | 17-27 | Pending 25.0 | Replaced by AcquireTokenByAuthorizationCodeWithCredentialsAsSecretText |
| AcquireTokenFromCache | (Text) | Text | public | 17-27 | Pending 25.0 | Replaced by procedure AcquireTokenFromCacheAsSecretText |
| AcquireTokenFromCacheState | (Text, Text, Text, var Text) | Text | public | 17-28 | - | - |
| AcquireGuestToken | (Text, Text) | Text | public | 17-28 | - | - |
| AcquireOnBehalfOfToken | (Text) | Text | public | 17-27 | Pending 25.0 | Replaced by AcquireOnBehalfOfTokenAsSecretText |
| AcquireOnBehalfOfTokenAndTokenCacheState | (Text, var Text) | Text | public | 17-28 | - | - |
| AcquireTokenFromCacheWithCredentials | (Text, Text, Text) | Text | public | 17-27 | Pending 25.0 | Replaced by AcquireTokenFromCacheWithCredentialsAsSecretText |
| AcquireApplicationToken | (Text, Text, Text, Text) | Text | public | 17-28 | - | - |
| GetSaasClientId | () | Text | public | 17-28 | - | - |
| GetInitialTenantDomainName | () | Text | public | 17-28 | - | - |
| CreateExchangeServiceWrapperWithToken | (Text, var DotNet ExchangeServiceWrapper) | - | public | 17-27 | Pending 25.0 | Replaced by CreateExchangeServiceWrapperWithToken(Token: SecretText; var Service: DotNet ExchangeServiceWrapper) |
| GetLastErrorMessage | () | Text | public | 20-28 | - | - |
| AcquireTokenByAuthorizationCodeAsSecretText | (SecretText, Text) | SecretText | public | 25-28 | - | - |
| AcquireTokenByAuthorizationCodeWithCredentialsAsSecretText | (SecretText, Text, SecretText, Text) | SecretText | public | 25-28 | - | - |
| AcquireTokenFromCacheAsSecretText | (Text) | SecretText | public | 25-28 | - | - |
| AcquireOnBehalfOfTokenAsSecretText | (Text) | SecretText | public | 25-28 | - | - |
| AcquireTokenFromCacheWithCredentialsAsSecretText | (Text, SecretText, Text) | SecretText | public | 25-28 | - | - |
| CreateExchangeServiceWrapperWithToken | (SecretText, var DotNet ExchangeServiceWrapper) | - | public | 25-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnInitialize | (Text, var DotNet ALAzureAdCodeGrantFlow) | 17-28 | - | - |
| Integration event | OnAcquireTokenByAuthorizationCode | (Text, Text, var Text) | 17-28 | - | - |
| Integration event | OnAcquireTokenByAuthorizationCodeWithCredentials | (Text, Text, Text, Text, var Text) | 17-28 | - | - |
| Integration event | OnAcquireTokenFromCache | (Text, var Text) | 17-28 | - | - |
| Integration event | OnAcquireTokenFromCacheState | (Text, Text, Text, var Text, var Text) | 17-28 | - | - |
| Integration event | OnAcquireGuestToken | (Text, Text, var Text) | 17-28 | - | - |
| Integration event | OnAcquireAcquireOnBehalfOfToken | (Text, var Text) | 17-28 | - | - |
| Integration event | OnAcquireOnBehalfOfTokenAndTokenCacheState | (Text, var Text, var Text) | 17-28 | - | - |
| Integration event | OnAcquireTokenFromCacheWithCredentials | (Text, Text, Text, var Text) | 17-28 | - | - |
| Integration event | OnGetSaasClientId | (var Text) | 17-28 | - | - |
| Integration event | OnCreateExchangeServiceWrapperWithToken | (Text, var DotNet ExchangeServiceWrapper) | 17-28 | - | - |
| Integration event | OnCheckProvider | (var 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.
