How can I test the OAuth 2.0 authorization code flow with PKCE in a Delphi desktop app using a test Azure AD tenant without production credentials?
0 reputation · 19 Aug 2026, 08:37 UTC
I need to verify that my Delphi VCL application can successfully obtain an access token from the Microsoft identity platform using the OAuth 2.0 authorization code flow with PKCE, while avoiding any use of production Azure AD credentials or real user data.
The test environment must use a dedicated Azure AD test tenant, a localhost redirect URI that matches the app registration, and a temporary user account solely for testing. I am uncertain how to configure the Delphi REST client to handle the redirect listener securely and how to validate the token response without persisting sensitive information.
Specific questions: How should I register the test Azure AD application to allow the localhost redirect URI with PKCE for a Delphi desktop client? What is the recommended approach to keep the authorization code and resulting tokens in memory only during automated tests? How can I confirm that the token acquisition succeeds without relying on production credentials?