feat: Flutter Windows Desktop support#656
Open
NandanPrabhu wants to merge 46 commits intobeta-release/v.2.1.0from
Open
feat: Flutter Windows Desktop support#656NandanPrabhu wants to merge 46 commits intobeta-release/v.2.1.0from
NandanPrabhu wants to merge 46 commits intobeta-release/v.2.1.0from
Conversation
nandan-bhat
reviewed
Mar 24, 2026
auth0_flutter/windows/request_handlers/web_auth/login_web_auth_request_handler.cpp
Outdated
Show resolved
Hide resolved
auth0_flutter/windows/request_handlers/web_auth/login_web_auth_request_handler.cpp
Outdated
Show resolved
Hide resolved
auth0_flutter/windows/request_handlers/web_auth/login_web_auth_request_handler.cpp
Show resolved
Hide resolved
nandan-bhat
reviewed
Mar 24, 2026
nandan-bhat
reviewed
Mar 24, 2026
nandan-bhat
previously approved these changes
Mar 26, 2026
pmathew92
reviewed
Mar 26, 2026
pmathew92
reviewed
Mar 26, 2026
pmathew92
reviewed
Mar 26, 2026
pmathew92
reviewed
Mar 26, 2026
pmathew92
reviewed
Mar 26, 2026
auth0_flutter/windows/request_handlers/web_auth/login_web_auth_request_handler.cpp
Outdated
Show resolved
Hide resolved
pmathew92
reviewed
Mar 26, 2026
auth0_flutter/windows/request_handlers/web_auth/login_web_auth_request_handler.cpp
Outdated
Show resolved
Hide resolved
pmathew92
reviewed
Mar 26, 2026
auth0_flutter/windows/request_handlers/web_auth/login_web_auth_request_handler.cpp
Show resolved
Hide resolved
…lidation mirrors swift sdk - CI fixes adding caching to reduce build times
… from auth0 and appcustom url
(cherry picked from commit bab56bb077b543f5db812533a6e5c3bbdf813077)
sanchitmehtagit
approved these changes
Mar 27, 2026
pmathew92
reviewed
Mar 27, 2026
auth0_flutter/windows/request_handlers/web_auth/login_web_auth_request_handler.cpp
Show resolved
Hide resolved
…e logic is bit refactored to read from scopes and parameters[scope]
pmathew92
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Changes
This PR adds native Windows desktop support to the
auth0_flutterSDK, enabling Auth0 Universal Login on Flutter Windows apps using the OAuth 2.0 Authorization Code Flow with PKCE. The implementation is a C++ Flutter plugin that integrates with the existing platform-interface layer without modifying the mobile (iOS/Android) code paths.New:
WindowsWebAuthenticationclassA dedicated Windows authentication class exposed via
Auth0.windowsWebAuthentication(). Unlike the mobileWebAuthenticationclass, this:appCallbackUrlexplicitlyCredentialsManagerNew: Windows C++ plugin (
auth0_flutter/windows/)login_web_auth_request_handler.cpplogout_web_auth_request_handler.cppoauth_helpers.cppauth0flutter://callback pollingauth0_client.cppid_token_validator.cppid_token_signature_validator.cppjwt_util.cpptoken_decoder.cppCredentialsstructuser_profile.cpp/user_identity.cppUserProfilestructtime_util.cppurl_utils.cppwindows_utils.cppWideToUtf8,BringFlutterWindowToFrontAuthentication flow:
code_verifier(32 cryptographically random bytes viaRAND_bytes) andcode_challenge(SHA-256 via OpenSSL, base64-URL encoded)statevalue for CSRF protection/authorizeURL with all parameters RFC 3986-encodedShellExecuteAPLUGIN_STARTUP_URLenvironment variable (set by Windows when the app is launched via theauth0flutter://custom scheme) every 200 ms until the callback arrives or the timeout expiresstateto prevent CSRF; extractcodecode+code_verifierfor tokens via POST to/oauth/tokenauth_time, nonce, RS256 signature)Key design decisions:
auth0flutter://callback(kDefaultRedirectUri). TheredirectUrlsent to Auth0 may differ (e.g. an HTTPS intermediary server URL); that server is responsible for forwarding toauth0flutter://callback?code=…&state=….authTimeoutSeconds) are consumed before building the authorize URL and are not appended to it.std::threadto avoid blocking the Flutter UI thread.openidscope is always enforced even when not explicitly passed, as required by OpenID Connect.New:
vcpkg.jsondependency manifestManages C++ dependencies via vcpkg, integrating automatically with CMake through the vcpkg toolchain file set by Flutter during
flutter build windows:cpprestsdkopensslRAND_bytes(PKCE entropy), SHA-256 (code challenge), RS256 signature verification, TLSboost-system/boost-date-time/boost-regexNew: Unit tests (Google Test,
auth0_flutter/windows/test/)oauth_helpers_test.cppid_token_validator_test.cppauth_time, nonce, leeway validationjwt_util_test.cpptime_util_test.cpptoken_decoder_test.cppurl_utils_test.cppuser_identity_test.cppuser_profile_test.cppwindows_utils_test.cppWideToUtf8wide-to-UTF-8 conversionTests are compiled as a separate
auth0_flutter_testsexecutable and registered with CTest, enabled via-DAUTH0_FLUTTER_ENABLE_TESTS=ON.New: CI pipeline (
.github/workflows/main.yml)Added a
windows-testsjob that installs vcpkg dependencies, builds the test executable with CMake, and runs all C++ unit tests via CTest onwindows-latest.📎 References
🎯 Testing
Automated — C++ unit tests (Windows)
All 9 test suites pass.
Automated — Flutter unit tests (any platform)
Manual — end-to-end on Windows
Prerequisites:
auth0flutteras a custom URL scheme pointing to your app executable (via installer or registry)myapp://callbackor 'https://mycustomhosteddomain.com/callback" to Allowed Callback URLs and **AllowedLogout URLs" in the Auth0 dashboardcd auth0_flutter/example flutter run -d windowsmyApp://callback?code=…&state=…To test the intermediary server pattern, point
redirectUrlat an HTTPS endpoint that reads thecodeandstatequery parameters and responds with a redirect toauth0flutter://callback?code=…&state=….