Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  PKCE Support for OAuthWebViewForm in C# Applications (Visual Studio)

    Posted 11-10-2025 03:28

    I am currently developing a C# application in Visual Studio and using the OAuthWebViewForm component for user authentication with Genesys Cloud.
    I understand that the Implicit Grant flow will soon be deprecated, and the recommended authentication method is Authorization Code Grant with PKCE.

    However, it appears that the current OAuthWebViewForm implementation for C# does not support PKCE and only works with the Implicit Grant flow.

    Could you please clarify the following:

    • Is there a PKCE-compatible version of OAuthWebViewForm available for C# applications?
    • Are there any plans to update OAuthWebViewForm to support PKCE in the future?
    • If not, what is the recommended approach for implementing PKCE authentication in C# desktop applications? If possible, could you provide any official guidance or sample code?

    Thank you very much for your assistance.

    Best regards,


    #PlatformAPI
    #PlatformSDK

    ------------------------------
    Naoki Ono
    ------------------------------


  • 2.  RE: PKCE Support for OAuthWebViewForm in C# Applications (Visual Studio)

    Posted 02-26-2026 07:19

    Hello,

    For your information, I have updated the sample code in the "Genesys Cloud - .NET OAuth WebView2 Control" repository - https://github.com/MyPureCloud/oauth-webview-dotnet

    Only the sample code is updated. There is no new version for the nuget package at this time (i.e. library managed by nuget package manager). Developers can simply import the code in their project (or build the library project locally) and use it in their code.

    The updated GenesysCloudOAuthWebView can initiate an OAuth Implicit Grant Flow or an OAuth PKCE Grant Flow.

    The choice of OAuth flow is controlled using the OAuthConfig's IsPKCEGrant property (default: true). PKCE Grant is defined as the default OAuth flow.

    Deprecation/Replacement in V2: the v1 BeginImplicitGrant() method is replaced with BeginOAuthGrant() method in v2.

    The OAuth WebView sample project generates the libraries for different framework versions: .Net Core 3.1, .Net Framework 4.7.2, .Net 8.0 (Windows), .Net 10.0 (Windows).

    Information on v2 can be found in the README file: https://github.com/MyPureCloud/oauth-webview-dotnet/blob/main/README.md

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 3.  RE: PKCE Support for OAuthWebViewForm in C# Applications (Visual Studio)

    Posted 6 days ago

    Hello,

    The latest oauth-webview-dotnet is still V2.0.0-alpha.

    I want to catchup and distribute my app with PKCE adaptive codes.
    How's it going today ?

    Yasuto Shinmura - Cloud Crossing Co., Ltd. Japan.



    ------------------------------
    Yasuto Shinmura
    Cloud Crossing Co., Ltd
    ------------------------------



  • 4.  RE: PKCE Support for OAuthWebViewForm in C# Applications (Visual Studio)

    Posted 5 days ago

    Hello,

    Sorry, it was an oversight. We forgot to remove the "alpha" from the README. The version is v2.0.

    The oauth-webview-dotnet repo has been updated to reflect v2.0. A tag release has also been created: https://github.com/MyPureCloud/oauth-webview-dotnet/releases/tag/v2.0

    As a reminder/as stated in my previous post above: "Only the sample code is updated. There is no new version for the nuget package at this time (i.e. library managed by nuget package manager). Developers can simply import the code in their project (or build the library project locally) and use it in their code."

    Regards,



    ------------------------------
    Jerome
    Senior Development Support Engineer
    ------------------------------



  • 5.  RE: PKCE Support for OAuthWebViewForm in C# Applications (Visual Studio)

    Posted 5 days ago

    Hello Jerome,

    Thank you for updatings.
    I will check it.

    Best Regards.



    ------------------------------
    Yasuto Shinmura
    Cloud Crossing Co., Ltd
    ------------------------------



  • 6.  RE: PKCE Support for OAuthWebViewForm in C# Applications (Visual Studio)

    Posted 6 days ago

    Hi Naoki,

    Thank you for your question.

    The current situation has changed recently. Genesys has introduced PKCE support in the Genesys Cloud .NET OAuth WebView2 Control project (oauth-webview-dotnet). The newer v2.0-alpha version supports both Authorization Code Grant with PKCE and Implicit Grant, with PKCE enabled by default through the OAuthConfig.IsPKCEGrant property. The previous BeginImplicitGrant() method has been replaced by BeginOAuthGrant(). turn1search1

    Regarding your questions:

    1. Is there a PKCE-compatible version of OAuthWebVieForm available for C# applications?

    Yes. The updated oauth-webview-dotnet project now supports PKCE Grant Flow. According to Genesys, developers can either import the source code directly into their projects or build the library locally. At the time of the announcement, a new NuGet package had not yet been published. turn1search2

    2. Are there plans to update OAuthWebViewForm to support PKCE?

    Yes. PKCE suport has already been added in the v2 implementation of the OAuth WebView component. The project repository and documentation describe these changes and position PKCE as the default authentication flow. turn1search4

    3. What is the recommended approach for implementing PKCE in a C# desktop applicaton?

    The recommended approach is to use the updated OAuth WebView component with Authorization Code Grant + PKCE, or implement the standard PKCE flow yourself using the Genesys Cloud OAuth endpoints. Genesys' official PKCE documentation outlines the process:

    1. Generate a code_verifier.
    2. Generate an S256 code_challenge.
    3. Redirect the user to the Genesys Cloud authorization endpoint with response_type=code.
    4. Receive the authorization code.
    5. Exchange the code and code_verifier for tokens at the token endpoint. turn1search3

    Useful references:

    Also note that Genesys has announced the deprecation of the Implicit Grant flow, making migration to PKCE the recommended long-term solution for browser-based and desktop client authentication scenarios.

    Thanks,



    ------------------------------
    Francis
    NA
    ------------------------------