Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
a10f01f
windows support added
NandanPrabhu Aug 17, 2025
ce3967c
windows support added
NandanPrabhu Aug 17, 2025
50ebfae
windows support added
NandanPrabhu Aug 17, 2025
f2d0866
windows support fixes build issue due to dependencies
NandanPrabhu Aug 21, 2025
c4c896d
fixes redirection issues
NandanPrabhu Sep 7, 2025
9b6d647
.env.example added
NandanPrabhu Sep 8, 2025
1213893
Merge branch 'main' into SDK-6071
NandanPrabhu Dec 7, 2025
15534c0
Adds PKCE flow
NandanPrabhu Dec 17, 2025
1d0112e
build(deps): bump codecov/codecov-action from 5.5.1 to 5.5.2 (#689)
dependabot[bot] Dec 10, 2025
9e9e103
Adding DPoP feature for flutter
utkrishtsahu Oct 6, 2025
0fb02f4
feat(android): Upgrade native SDK to 3.9.0 and adapt to breaking changes
utkrishtsahu Oct 14, 2025
cdc2327
adding Dp feature with platform updates
utkrishtsahu Nov 20, 2025
a92e5d4
adding changes as per github action bot
utkrishtsahu Nov 20, 2025
5c29020
addressed bot PR review comments
utkrishtsahu Nov 20, 2025
f2742d3
Fixing UT failure issue in CI for android,ios and macos
utkrishtsahu Nov 20, 2025
f679eeb
Fixed review comments by prince and claude
utkrishtsahu Nov 21, 2025
ba1079b
restored to java 8 and handled review comments
utkrishtsahu Nov 27, 2025
ad4bdcb
Resolving Claud code review
utkrishtsahu Dec 1, 2025
59d453a
Handle review comments and added all UT for flutter including DPoP
utkrishtsahu Dec 2, 2025
e5ef368
addressing unit test failure for android,ios and symlink
utkrishtsahu Dec 2, 2025
8d60adc
Fix race conditions in iOS/macOS unit tests and document cache-only b…
utkrishtsahu Dec 3, 2025
3885a98
Fix iOS/macOS unit test failures
utkrishtsahu Dec 3, 2025
6f5ea14
Resilving review comments and ios UT test failure
utkrishtsahu Dec 3, 2025
51df028
Fix CI failures: Add missing files and update test mocks
utkrishtsahu Dec 3, 2025
d68977e
Fix iOS/macOS unit test timeouts by reverting async test changes
utkrishtsahu Dec 3, 2025
ff9894b
Fix iOS unit test timeouts by adding explicit 5s timeouts to all expe…
utkrishtsahu Dec 3, 2025
248b801
fix iOS unit test timeouts by reverting to proven async/sync patterns
utkrishtsahu Dec 5, 2025
d361a2a
Fixes iOS UTs
NandanPrabhu Dec 5, 2025
155ba50
Adds scenedelegate conformance
NandanPrabhu Dec 5, 2025
cc21832
Address review comments: separate DPoP channel and simplify docs
utkrishtsahu Dec 5, 2025
1115242
Fix test: use correct index for CredentialsManagerMethodCallHandler
utkrishtsahu Dec 5, 2025
e77a5e4
Removed UT as per review comments
utkrishtsahu Dec 5, 2025
580338c
addresed few review comments
utkrishtsahu Dec 5, 2025
a3c5eee
refactor: Move DPoP utility methods from AuthenticationApi to Auth0 c…
utkrishtsahu Dec 5, 2025
ff11a37
Handled review comments:Decoupling in all platforms,removal of commen…
utkrishtsahu Dec 8, 2025
fc88d2c
added UT in CredentialsManagerHandlerTests.swift
utkrishtsahu Dec 8, 2025
6e1cec2
feat: refactor DPoP operations and add tokenType parameter to userPro…
utkrishtsahu Dec 9, 2025
2029df8
Fix iOS CredentialsManager caching tests
utkrishtsahu Dec 9, 2025
a260001
Fixing ios CI failure
utkrishtsahu Dec 9, 2025
0fc8550
Handling review comments UserInfoApiRequestHandler and AuthAPIUserInf…
utkrishtsahu Dec 9, 2025
648acd4
fixing lint issues
utkrishtsahu Dec 10, 2025
938f928
Docs: Add v2.0.0 migration notice and update documentation
utkrishtsahu Dec 10, 2025
551ef0f
Fix linting issue in auth0_flutter folder
utkrishtsahu Dec 10, 2025
767a2c8
Release afpi-v2.0.0-beta.1 (#695)
utkrishtsahu Dec 11, 2025
ac65a8a
Release af-v2.0.0-beta.1 (#696)
utkrishtsahu Dec 11, 2025
17a4020
build(deps): bump actions/cache from 4 to 5 in /.github/actions/setup…
dependabot[bot] Dec 14, 2025
5e9f5c2
build(deps): bump actions/upload-artifact from 5 to 6 in /.github/act…
dependabot[bot] Dec 14, 2025
9cf2471
build(deps): bump actions/upload-artifact from 5 to 6 in /.github/act…
dependabot[bot] Dec 15, 2025
bc450a3
build(deps): bump actions/download-artifact from 6.0.0 to 7.0.0 (#699)
dependabot[bot] Dec 15, 2025
85b7cd9
build(deps): bump actions/upload-artifact from 5 to 6 (#698)
dependabot[bot] Dec 15, 2025
81d0af2
build(deps-dev): bump glob from 10.4.5 to 10.5.0 in /appium-test (#683)
dependabot[bot] Dec 15, 2025
dea4fa3
PKCE bug fixes
NandanPrabhu Dec 19, 2025
8f57ad9
code refactoring
NandanPrabhu Dec 19, 2025
bac263a
fixes build issues
NandanPrabhu Dec 21, 2025
302be07
fixes build issues
NandanPrabhu Dec 21, 2025
dbcbd29
Fixes issue due to expires in
NandanPrabhu Dec 21, 2025
12f5b37
Fixes PKCE issues
NandanPrabhu Jan 3, 2026
6136181
Fixes PKCE issues
NandanPrabhu Jan 3, 2026
4bf059e
adds logout code
NandanPrabhu Jan 5, 2026
eb4a138
adds login to bring app window to the front on redirection
NandanPrabhu Jan 8, 2026
69e57aa
build(deps): bump ruby/setup-ruby in /.github/actions/setup-darwin
dependabot[bot] Dec 18, 2025
a5ac9e6
fix: Fixes the build error when running the `dart run build_runner bu…
pmathew92 Dec 19, 2025
6b5ea13
build(deps): bump ruby/setup-ruby from 1.273.0 to 1.274.0 in /.github…
dependabot[bot] Dec 22, 2025
50bf132
build(deps): bump ruby/setup-ruby from 1.274.0 to 1.275.0 in /.github…
dependabot[bot] Dec 24, 2025
9637414
build(deps): bump ruby/setup-ruby from 1.275.0 to 1.278.0 in /.github…
dependabot[bot] Jan 4, 2026
282cdeb
build(deps): bump ruby/setup-ruby from 1.278.0 to 1.279.0 in /.github…
dependabot[bot] Jan 7, 2026
e9e935f
Merge branch 'main' into SDK-6071
NandanPrabhu Jan 8, 2026
c1cd636
deleted few unused files
NandanPrabhu Jan 8, 2026
6ad8d90
Add unit test and CI setup
NandanPrabhu Jan 20, 2026
8bba351
Merge branch 'main' into SDK-6071
NandanPrabhu Jan 20, 2026
5f1b308
Resolves PR comments - adds uniform naming convention to files - perc…
NandanPrabhu Jan 20, 2026
a627e09
Merge branch 'main' into SDK-6071
NandanPrabhu Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 81 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,72 @@ jobs:
name: Test results
path: 'auth0_flutter/example/build/app/reports/androidTests/*.xml'

test-windows-unit:
name: Run native Windows unit tests
runs-on: windows-latest
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}

steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3

- name: Install Flutter
uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # pin@v2.21.0
with:
flutter-version: ${{ env.flutter }}
channel: stable
cache: true

- name: Add example/.env
working-directory: auth0_flutter
run: Copy-Item example/.env.example example/.env
shell: powershell

- name: Set up vcpkg
uses: lukka/run-vcpkg@v11 # pin@v11
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: '66c0373dc7fca549e5803087b9487edfe3aca0a1'

- name: Install vcpkg dependencies
run: |
${{ github.workspace }}\vcpkg\vcpkg install cpprestsdk:x64-windows openssl:x64-windows boost-system:x64-windows boost-date-time:x64-windows boost-regex:x64-windows
shell: cmd

- name: Build Windows example app
working-directory: auth0_flutter/example
run: flutter build windows --debug
env:
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake

- name: Install OpenCppCoverage
run: choco install opencppcoverage
shell: powershell

- name: Build Windows unit tests
working-directory: auth0_flutter/windows
run: |
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DAUTH0_FLUTTER_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
shell: cmd

- name: Run Windows unit tests with coverage
working-directory: auth0_flutter/windows
run: |
& "C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" `
--sources ${{ github.workspace }}\auth0_flutter\windows `
--excluded_sources ${{ github.workspace }}\auth0_flutter\windows\test `
--export_type cobertura:coverage.xml `
--export_type html:coverage_html `
-- .\build\Debug\auth0_flutter_tests.exe
shell: powershell

- name: Upload coverage report
uses: actions/upload-artifact@v6
with:
name: Windows coverage
path: auth0_flutter/windows/coverage.xml

# test-android-smoke:
# name: Run native Android smoke tests using API-level ${{ matrix.android-api }}
# runs-on: macos-latest-xl
Expand Down Expand Up @@ -419,7 +485,8 @@ jobs:
test-auth0_flutter,
test-auth0_flutter_platform_interface,
test-ios-unit,
test-android-unit
test-android-unit,
test-windows-unit
]

steps:
Expand Down Expand Up @@ -450,6 +517,12 @@ jobs:
name: Android coverage
path: coverage/android

- name: Download coverage report for Windows
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: Windows coverage
path: coverage/windows

- name: Upload coverage report for auth0_flutter
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
Expand Down Expand Up @@ -477,3 +550,10 @@ jobs:
name: Auth0 Flutter
flags: auth0_flutter_android
directory: coverage/android

- name: Upload coverage report for Windows
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
name: Auth0 Flutter
flags: auth0_flutter_windows
directory: coverage/windows
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Global coverage
coverage/
**/.vs/

appium-test/node_modules/*

Expand Down
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

32 changes: 0 additions & 32 deletions .idea/auth0-flutter.iml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

1 change: 1 addition & 0 deletions auth0_flutter/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ version:
channel: stable

project_type: plugin

106 changes: 93 additions & 13 deletions auth0_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ We're excited to announce the release of auth0_flutter v2.0.0!

### Requirements

| Flutter | Android | iOS | macOS |
| :---------- | :-------------- | :---------------- | :---------------- |
| SDK 3.24.0+ | Android API 21+ | iOS 14+ | macOS 11+ |
| Dart 3.5.0+ | Java 8+ | Swift 5.9+ | Swift 5.9+ |
| | | Xcode 15.x / 16.x | Xcode 15.x / 16.x |
| Flutter | Android | iOS | macOS | Windows |
| :---------- | :-------------- | :---------------- | :---------------- | :------------------------------- |
| SDK 3.24.0+ | Android API 21+ | iOS 14+ | macOS 11+ | Windows 10+ |
| Dart 3.5.0+ | Java 8+ | Swift 5.9+ | Swift 5.9+ | C++ 17, Visual Studio 2022 |
| | | Xcode 15.x / 16.x | Xcode 15.x / 16.x | vcpkg (for dependencies) |

### Installation

Expand Down Expand Up @@ -77,6 +77,7 @@ Under the **Application URIs** section of the **Settings** page, configure the f
- Android: `SCHEME://YOUR_DOMAIN/android/YOUR_PACKAGE_NAME/callback`
- iOS: `https://YOUR_DOMAIN/ios/YOUR_BUNDLE_ID/callback,YOUR_BUNDLE_ID://YOUR_DOMAIN/ios/YOUR_BUNDLE_ID/callback`
- macOS: `https://YOUR_DOMAIN/macos/YOUR_BUNDLE_ID/callback,YOUR_BUNDLE_ID://YOUR_DOMAIN/macos/YOUR_BUNDLE_ID/callback`
- Windows: `https://YOUR_HOSTED_DOMAIN/callback` (or your custom callback URL on your intermediary server)
Copy link
Contributor

@pmathew92 pmathew92 Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention the callback url here as this is a workaround we suggest for users. This should be mentioned in the example code . For windows by default we have the flutterapp://calback uri defined


<details>
<summary>Example</summary>
Expand All @@ -86,11 +87,37 @@ If your Auth0 domain was `company.us.auth0.com` and your package name (Android)
- Android: `https://company.us.auth0.com/android/com.company.myapp/callback`
- iOS: `https://company.us.auth0.com/ios/com.company.myapp/callback,com.company.myapp://company.us.auth0.com/ios/com.company.myapp/callback`
- macOS: `https://company.us.auth0.com/macos/com.company.myapp/callback,com.company.myapp://company.us.auth0.com/macos/com.company.myapp/callback`
- Windows: `https://your-app.example.com/callback` (your intermediary server endpoint)

</details>

> 💡 **Windows**: The Windows implementation uses a custom scheme callback architecture (`auth0flutter://callback`). This requires an intermediary server to receive the Auth0 callback and forward it to your Windows app via the custom protocol. The intermediary server URL (e.g., `https://your-app.example.com/callback`) should be configured as the callback URL in your Auth0 dashboard. The server should handle the Auth0 redirect and trigger the `auth0flutter://` protocol to activate your app with the authorization code and state parameters.

Take note of the **client ID** and **domain** values under the **Basic Information** section. You'll need these values in the next step.

##### Security Considerations for Custom URL Schemes

> ⚠️ **Important Security Information**
>
> Custom URL schemes (nonverifiable callback URIs) can be vulnerable to **app impersonation attacks**, where malicious apps could potentially intercept OAuth authorization codes by registering the same custom scheme on a device.
>
> **Recommended Best Practices:**
>
> - **Use HTTPS-based schemes whenever possible:**
> - iOS 17.4+ / macOS 14.4+: Use Universal Links
> - Android: Use Android App Links with HTTPS schemes
> - These verifiable schemes cryptographically bind your app to your domain, preventing impersonation
>
> - **If you must use custom URL schemes:**
> - Implement additional security measures such as PKCE (Proof Key for Code Exchange), which is automatically enabled in this SDK
> - Consider using short-lived authorization codes
> - Implement additional client-side validation
> - Be aware that custom schemes offer no protection against malicious apps on the same device
>
> - **For Windows applications:** Custom schemes are currently required due to platform limitations. Ensure your intermediary server validates requests and uses secure communication
>
> 📖 For more details about app impersonation risks and mitigation strategies, see [Auth0's Security Guidance: Measures Against App Impersonation](https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation)

#### 🌐 Web

Head to the [Auth0 Dashboard](https://manage.auth0.com/#/applications/) and create a new **Single Page** application.
Expand Down Expand Up @@ -127,7 +154,7 @@ Take note of the **client ID** and **domain** values under the **Basic Informati

### Configure the SDK

#### 📱 Mobile/macOS
#### 📱 Mobile/macOS/Windows

Start by importing `auth0_flutter/auth0_flutter.dart`.

Expand Down Expand Up @@ -247,6 +274,46 @@ If you have a [custom domain](https://auth0.com/docs/customize/custom-domains),

> ⚠️ For the associated domain to work, your app must be signed with your team certificate **even when building for the iOS simulator**. Make sure you are using the Apple Team whose Team ID is configured in the **Settings** page of your application.

##### Windows: Configure protocol handler and intermediary server

Windows authentication requires two components:

1. **Custom Protocol Handler**: Your Windows app needs to register the `auth0flutter://` protocol handler
2. **Intermediary Server**: A hosted server that receives the Auth0 callback and forwards it to your app

**Step 1: Register the custom protocol handler**

The `auth0flutter://` protocol should be automatically registered when your app is installed. The Flutter Windows plugin handles protocol activation through the `PLUGIN_STARTUP_URL` environment variable.

**Step 2: Set up your intermediary server**

Create a web endpoint (e.g., `https://your-app.example.com/callback`) that:
1. Receives the Auth0 callback with `code` and `state` parameters
2. Redirects to `auth0flutter://callback?code=...&state=...`

Example server implementation:

```javascript
// Node.js/Express example
app.get('/callback', (req, res) => {
const { code, state, error, error_description } = req.query;

if (error) {
res.redirect(`auth0flutter://callback?error=${error}&error_description=${error_description}`);
} else {
res.redirect(`auth0flutter://callback?code=${code}&state=${state}`);
}
});
```

**Step 3: Configure Auth0 callback URLs**

In your Auth0 application settings, add your intermediary server URL:
- **Allowed Callback URLs**: `https://your-app.example.com/callback`
- **Allowed Logout URLs**: `https://your-app.example.com/logout`

The SDK will automatically use the `auth0flutter://callback` custom scheme internally to receive the forwarded callback from your server.

#### 🌐 Web

Start by importing `auth0_flutter/auth0_flutter_web.dart`.
Expand All @@ -271,24 +338,26 @@ Finally, in your `index.html` add the following `<script>` tag:

### Logging in

#### 📱 Mobile/macOS
#### 📱 Mobile/macOS/Windows

Present the [Universal Login](https://auth0.com/docs/authenticate/login/auth0-universal-login) page in the `onPressed` callback of your **Login** button.

```dart
// Use a Universal Link callback URL on iOS 17.4+ / macOS 14.4+
// useHTTPS is ignored on Android
// useHTTPS is ignored on Android and Windows
final credentials = await auth0.webAuthentication().login(useHTTPS: true);

// Access token -> credentials.accessToken
// User profile -> credentials.user
```

auth0_flutter automatically stores the user's credentials using the built-in [Credentials Manager](#credentials-manager) instance. You can access this instance through the `credentialsManager` property.
**Credential Storage:**
- **Mobile/macOS**: auth0_flutter automatically stores the user's credentials using the built-in [Credentials Manager](#credentials-manager) instance. You can access this instance through the `credentialsManager` property:
```dart
final credentials = await auth0.credentialsManager.credentials();
```

```dart
final credentials = await auth0.credentialsManager.credentials();
```
- **Windows**: Credentials are **not** automatically stored. You must manually store and manage the `credentials` object returned from `login()` in your app (e.g., using `shared_preferences` or secure storage)

For other comprehensive examples, see the [EXAMPLES.md](EXAMPLES.md) document.

Expand Down Expand Up @@ -407,19 +476,28 @@ Check the [FAQ](FAQ.md) for more information about the alert box that pops up **
- [Retrieve stored credentials](EXAMPLES.md#retrieve-stored-credentials) - fetch the user's credentials from the storage, automatically renewing them if they have expired.
- [Retrieve user information](EXAMPLES.md#retrieve-user-information) - fetch the latest user information from the `/userinfo` endpoint.

### 🪟 Windows

- **Custom Protocol Handler**: Windows uses `auth0flutter://` custom scheme for OAuth callbacks, requiring an intermediary server (see setup guide above)
- **No Credentials Manager**: Credential storage is not currently supported on Windows. Credentials must be managed manually in your app
- **C++ SDK**: The Windows implementation is built with native C++ using PKCE for secure authentication
- **Unit Tests**: Comprehensive unit tests for Windows OAuth helpers are available in `windows/test/`

### 🌐 Web

- [Handling credentials on the web](EXAMPLES.md#handling-credentials-on-the-web) - how to check and retrieve credentials on the web platform.

## API reference

### 📱 Mobile/macOS
### 📱 Mobile/macOS/Windows

#### Web Authentication

- [login](https://pub.dev/documentation/auth0_flutter/latest/auth0_flutter/WebAuthentication/login.html)
- [logout](https://pub.dev/documentation/auth0_flutter/latest/auth0_flutter/WebAuthentication/logout.html)

> 💡 **Windows**: Web Authentication on Windows uses a custom scheme callback (`auth0flutter://`) that requires an intermediary server to forward the Auth0 callback to your app. See the [Windows configuration section](#windows-configure-protocol-handler-and-intermediary-server) above for setup details.

#### API

- [login](https://pub.dev/documentation/auth0_flutter/latest/auth0_flutter/AuthenticationApi/login.html)
Expand All @@ -432,6 +510,8 @@ Check the [FAQ](FAQ.md) for more information about the alert box that pops up **

#### Credentials Manager

> ⚠️ **Note**: Credentials Manager is available on Mobile (Android/iOS) and macOS platforms only. Windows does not currently support credential storage. On Windows, you must manually manage credentials returned from `login()`.

- [credentials](https://pub.dev/documentation/auth0_flutter/latest/auth0_flutter/DefaultCredentialsManager/credentials.html)
- [hasValidCredentials](https://pub.dev/documentation/auth0_flutter/latest/auth0_flutter/DefaultCredentialsManager/hasValidCredentials.html)
- [storeCredentials](https://pub.dev/documentation/auth0_flutter/latest/auth0_flutter/DefaultCredentialsManager/storeCredentials.html)
Expand Down
2 changes: 1 addition & 1 deletion auth0_flutter/example/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ AUTH0_CLIENT_ID=YOUR_AUTH0_CLIENT_ID
# settings page of your Auth0 application with the custom scheme value.
# 2. Update the scheme value in android/app/src/main/res/values/strings.xml
#
AUTH0_CUSTOM_SCHEME=YOUR_AUTH0_CUSTOM_SCHEME
AUTH0_CUSTOM_SCHEME=YOUR_AUTH0_CUSTOM_SCHEME
Loading
Loading