---
title: "Codeunit 502 OAuth2Impl, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/points/
object: https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/
app: "System Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 502 OAuth2Impl, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/points/

50 procedures and triggers with a step in src/System Application/App/OAuth2/OAuth2Impl.Codeunit.al, in source order, read from the text, not from a run.

## GetAuthRequestUrl

[Line 34](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L34).

- [50](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L50) calls `AppendPromptParameter`

## GetAuthRequestUrl

[Line 61](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L61).

- [91](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L91) calls `AppendPromptParameter`
- [93](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L93) calls `AppendAudienceParameter`

## GetOAuthProperties

[Line 124](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L124).

- [134](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L134) calls `GetPropertyFromCode`
- [135](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L135) calls `GetPropertyFromCode`
- [136](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L136) calls `GetPropertyFromCode`

## GetDefaultRedirectUrl

[Line 139](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L139).

- [150](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L150) calls [Codeunit 457 Environment Information](https://jonas-paprotka.de/ref/codeunit/457-environment-information/) `IsSaaSInfrastructure`
- [151](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L151) calls `GetBaseUrl`

## RequestClientCredentialsAdminPermissions

[Line 172](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L172).

- [179](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L179) calls `GetDefaultRedirectUrl`
- [183](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L183) calls [Page 502 OAuth2ControlAddIn](https://jonas-paprotka.de/ref/page/502-oauth2controladdin/) `SetOAuth2Properties`
- [186](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L186) calls [Page 502 OAuth2ControlAddIn](https://jonas-paprotka.de/ref/page/502-oauth2controladdin/) `GetGrantConsentSuccess`
- [187](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L187) calls [Page 502 OAuth2ControlAddIn](https://jonas-paprotka.de/ref/page/502-oauth2controladdin/) `GetAuthError`

## AcquireTokenByAuthorizationCode

[Line 191](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L191).

- [197](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L197) calls `Initialize`
- [199](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L199) calls `GetAuthRequestUrl`
- [201](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L201) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`
- [209](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L209) calls `AcquireTokenByAuthorizationCodeWithCredentials`

## AcquireTokenByAuthorizationCodeWithCertificate

[Line 221](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L221).

- [227](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L227) calls `Initialize`
- [229](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L229) calls `GetAuthRequestUrl`
- [231](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L231) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`

## AcquireTokenByAuthorizationCode

[Line 240](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L240).

- [246](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L246) calls `Initialize`
- [248](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L248) calls `GetAuthRequestUrl`
- [250](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L250) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`
- [258](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L258) calls `AcquireTokenByAuthorizationCodeWithCredentials`

## AcquireTokenByAuthorizationCodeWithCertificate

[Line 270](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L270).

- [276](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L276) calls `Initialize`
- [278](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L278) calls `GetAuthRequestUrl`
- [280](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L280) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`

## AcquireTokensByAuthorizationCode

[Line 289](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L289).

- [295](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L295) calls `Initialize`
- [297](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L297) calls `GetAuthRequestUrl`
- [299](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L299) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`
- [304](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L304) calls `AcquireTokensByAuthorizationCodeWithCredentials`

## AcquireTokensByAuthorizationCodeWithCertificate

[Line 316](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L316).

- [322](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L322) calls `Initialize`
- [324](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L324) calls `GetAuthRequestUrl`
- [326](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L326) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`

## AcquireTokenAndTokenCacheByAuthorizationCode

[Line 335](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L335).

- [341](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L341) calls `Initialize`
- [343](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L343) calls `GetAuthRequestUrl`
- [345](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L345) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`
- [350](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L350) calls `AcquireTokenAndTokenCacheByAuthorizationCodeWithCredentials`

## AcquireTokenAndTokenCacheByAuthorizationCodeWithCertificate

[Line 362](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L362).

- [368](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L368) calls `Initialize`
- [370](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L370) calls `GetAuthRequestUrl`
- [372](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L372) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`

## AcquireTokensAndTokenCacheByAuthorizationCode

[Line 381](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L381).

- [387](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L387) calls `Initialize`
- [389](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L389) calls `GetAuthRequestUrl`
- [391](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L391) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`
- [396](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L396) calls `AcquireTokensAndTokenCacheByAuthorizationCodeWithCredentials`

## AcquireTokensAndTokenCacheByAuthorizationCodeWithCertificate

[Line 408](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L408).

- [414](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L414) calls `Initialize`
- [416](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L416) calls `GetAuthRequestUrl`
- [418](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L418) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`

## SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn

[Line 427](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L427).

- [436](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L436) calls [Page 502 OAuth2ControlAddIn](https://jonas-paprotka.de/ref/page/502-oauth2controladdin/) `SetOAuth2Properties`
- [439](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L439) calls [Page 502 OAuth2ControlAddIn](https://jonas-paprotka.de/ref/page/502-oauth2controladdin/) `GetAuthCode`
- [440](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L440) calls [Page 502 OAuth2ControlAddIn](https://jonas-paprotka.de/ref/page/502-oauth2controladdin/) `GetAuthError`

## AcquireOnBehalfOfToken

[Line 444](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L444).

- [446](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L446) calls `Initialize`

## AcquireOnBehalfOfToken

[Line 451](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L451).

- [455](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L455) calls `FillScopesArray`
- [456](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L456) calls `Initialize`

## AcquireOnBehalfOfTokens

[Line 461](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L461).

- [466](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L466) calls `FillScopesArray`
- [467](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L467) calls `Initialize`

## AcquireOnBehalfAccessTokenAndTokenCache

[Line 473](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L473).

- [475](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L475) calls `Initialize`

## AcquireOnBehalfAccessTokenAndTokenCache

[Line 479](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L479).

- [483](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L483) calls `FillScopesArray`
- [484](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L484) calls `Initialize`

## AcquireOnBehalfTokensAndTokenCache

[Line 488](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L488).

- [493](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L493) calls `FillScopesArray`
- [494](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L494) calls `Initialize`

## AcquireOnBehalfOfTokenByTokenCache

[Line 500](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L500).

- [502](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L502) calls `Initialize`

## AcquireOnBehalfOfTokenByTokenCache

[Line 506](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L506).

- [510](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L510) calls `FillScopesArray`
- [511](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L511) calls `Initialize`

## AcquireOnBehalfOfTokensByTokenCache

[Line 515](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L515).

- [520](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L520) calls `FillScopesArray`
- [521](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L521) calls `Initialize`

## AcquireOnBehalfOfTokenByTokenCache

[Line 527](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L527).

- [531](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L531) calls `FillScopesArray`
- [532](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L532) calls `Initialize`

## AcquireOnBehalfOfTokensByTokenCache

[Line 536](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L536).

- [541](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L541) calls `FillScopesArray`
- [542](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L542) calls `Initialize`

## AcquireTokenFromCache

[Line 549](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L549).

- [551](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L551) calls `Initialize`

## AcquireTokenFromCacheWithCertificate

[Line 564](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L564).

- [566](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L566) calls `Initialize`

## AcquireTokenFromCache

[Line 571](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L571).

- [575](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L575) calls `FillScopesArray`
- [576](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L576) calls `Initialize`

## AcquireTokenFromCacheWithCertificate

[Line 589](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L589).

- [593](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L593) calls `FillScopesArray`
- [594](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L594) calls `Initialize`

## AcquireTokensFromCache

[Line 599](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L599).

- [604](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L604) calls `FillScopesArray`
- [605](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L605) calls `Initialize`

## AcquireTokensFromCacheWithCertificate

[Line 620](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L620).

- [625](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L625) calls `FillScopesArray`
- [626](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L626) calls `Initialize`

## AcquireTokensWithCertificate

[Line 643](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L643).

- [648](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L648) calls `FillScopesArray`
- [649](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L649) calls `Initialize`

## AcquireTokenWithClientCredentials

[Line 656](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L656).

- [658](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L658) calls `Initialize`

## AcquireTokenWithClientCredentials

[Line 665](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L665).

- [669](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L669) calls `FillScopesArray`
- [670](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L670) calls `Initialize`

## AcquireTokenByAuthorizationCodeWithCredentials

[Line 697](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L697).

- [701](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L701) calls `FillScopesArray`

## AcquireTokenByAuthorizationCodeWithCertificate

[Line 714](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L714).

- [718](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L718) calls `FillScopesArray`

## AcquireTokensByAuthorizationCodeWithCredentials

[Line 723](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L723).

- [728](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L728) calls `FillScopesArray`

## AcquireTokensByAuthorizationCodeWithCertificate

[Line 743](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L743).

- [748](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L748) calls `FillScopesArray`

## AcquireTokenAndTokenCacheByAuthorizationCodeWithCredentials

[Line 755](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L755).

- [759](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L759) calls `FillScopesArray`

## AcquireTokenAndTokenCacheByAuthorizationCodeWithCertificate

[Line 772](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L772).

- [776](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L776) calls `FillScopesArray`

## AcquireTokensAndTokenCacheByAuthorizationCodeWithCredentials

[Line 781](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L781).

- [786](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L786) calls `FillScopesArray`

## AcquireTokensAndTokenCacheByAuthorizationCodeWithCertificate

[Line 801](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L801).

- [806](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L806) calls `FillScopesArray`

## AcquireTokensWithUserCredentials

[Line 813](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L813).

- [821](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L821) calls `Initialize`
- [822](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L822) calls `FillScopesArray`

## AcquireTokensWithUserCredentials

[Line 831](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L831).

- [837](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L837) calls `Initialize`
- [838](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L838) calls `FillScopesArray`

## AcquireAuthorizationCode

[Line 845](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L845).

- [850](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L850) calls `Initialize`
- [852](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L852) calls `GetAuthRequestUrl`
- [854](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L854) calls `SetPropertiesBasedOnAuthRequestUrlAndRunOAuth2ControlAddIn`

## GetClaims

[Line 861](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L861).

- [876](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L876) calls [Codeunit 4110 Base64 Convert](https://jonas-paprotka.de/ref/codeunit/4110-base64-convert/) `FromBase64`

## Initialize

[Line 884](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L884), local.

- [889](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L889) calls `GetDefaultRedirectUrl`

## Initialize

[Line 896](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L896), local.

- [901](https://jonas-paprotka.de/ref/codeunit/502-oauth2impl/source/#L901) calls `GetDefaultRedirectUrl`

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
