An Azure service that provides an integrated environment for bot development.
Hello @Kuldeep Ravaliya
Based on the current Bot Service documentation and the behavior you reproduced, don't treat PKCE as supported by Azure Bot Service OAuth connections at this time.
Microsoft documents the Generic OAuth providers and their supported templates. For the customizable OAuth 2 Generic Provider, documented placeholders include {ClientId}, {RedirectUrl}, {Scopes}, {State}, etc., but Microsoft does not document {CodeChallenge} / {CodeVerifier} as supported dynamic substitutions.
That aligns with your results:
- Generic OAuth 2 with PKCE S256 doesn't emit code_challenge.
- OAuth 2 Generic Provider sends {CodeChallenge} literally rather than generating/substituting a challenge.
The Bot Framework Token Service normally performs the OAuth authorization-code flow and manages the resulting tokens on behalf of the bot.
Therefore, if your identity provider requires PKCE, I don't see a documented way to implement it using the built-in Bot Service OAuth connection alone. You would likely need to implement the PKCE authorization flow outside the Bot Service Token Service, where your application generates and retains the code_verifier and supplies the corresponding code_challenge.
Given that the Azure portal exposes a PKCE Type field despite the documented/provider behavior, raise this with Microsoft Support. It could be an undocumented feature, a portal/backend mismatch, or a defect, and Microsoft would need to confirm which.
Avoid relying on the PKCE field in production until Microsoft confirms the expected behavior.
Help make this community better for everyone: if this answer resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution.