Skip to content

chore: windows support#24

Open
andreydobrikov wants to merge 2 commits intomainfrom
feature/windows-support
Open

chore: windows support#24
andreydobrikov wants to merge 2 commits intomainfrom
feature/windows-support

Conversation

@andreydobrikov
Copy link
Collaborator

@andreydobrikov andreydobrikov commented Mar 23, 2026

This pull request introduces Windows-specific support for OAuth authentication using an embedded WebView, along with CMake build configuration for plugin management. The main changes include a new Windows WebView OAuth flow, updates to session restoration logic, and the addition of CMake files to build platform-specific plugins. Several Unity meta files are also added for asset management.

Windows OAuth WebView Support:

  • Added a new OAuthWindowsWebViewFlow class to enable OAuth authentication using an embedded WebView on Windows platforms. This class leverages a WindowsWebViewHandler to handle the OAuth flow and callback interception. (SDK/Runtime/Auth/OAuth/OAuthFlows/OAuthWindowsWebViewFlow.cs, [1] [2]
  • Updated platform detection logic to use OAuthWindowsWebViewFlow for Windows Editor and Player, ensuring the correct OAuth flow is selected on Windows. (SDK/Runtime/Auth/OAuth/OAuthFlows/IOAuthFlow.cs, SDK/Runtime/Auth/OAuth/OAuthFlows/IOAuthFlow.csR21-R27)
  • Updated the WebView handler selection to use WindowsWebViewHandler for Windows standalone and editor builds. (SDK/Runtime/EmbeddedWallet/IWebviewHandler.cs, SDK/Runtime/EmbeddedWallet/IWebviewHandler.csR26-R27)

OAuth Flow and Session Improvements:

  • Fixed OAuth credential prompting to use the transformed redirect URI (such as a localhost callback), ensuring the correct URI is used in both initialization and the WebView flow. (SDK/Runtime/Auth/OAuth/LoginWithOAuth.cs, SDK/Runtime/Auth/OAuth/LoginWithOAuth.csL44-R45)
  • Improved session restoration logic to properly handle expired or invalid tokens, refresh when needed, and log out if no refresh token is available. This ensures better handling of edge cases and offline scenarios. (SDK/Runtime/Auth/AuthDelegator.cs, SDK/Runtime/Auth/AuthDelegator.csR274-R303)

CMake Build System for Plugins:

  • Introduced new CMake build scripts to manage platform-specific plugin builds, including options for Windows (WebView2) and Linux (WebKitGTK) plugins. This includes logic to locate and link the WebView2 SDK for Windows builds. (SDK/Plugins/CMakeLists.txt, [1]; SDK/Plugins/Windows/CMakeLists.txt, [2]; SDK/Plugins/CMakeLists.txt.meta, [3]; SDK/Plugins/Windows/CMakeLists.txt.meta, [4]

Unity Asset Management:

  • Added Unity .meta files for new or updated plugin directories and files to ensure proper asset tracking in the Unity editor. (SDK/Plugins/Windows.meta, [1]; SDK/Plugins/Windows/PrivyWebView.cpp.meta, [2]; SDK/Plugins/Windows/x86_64.meta, [3]; SDK/Plugins/Windows/x86_64/Release.meta, [4]; SDK/Plugins/Windows/x86_64/Release/PrivyWebView.dll.meta, [5]

Windows native WebView plugin
Message passing between web view and Unity
Added build/support doc for windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant