Skip to content

Conversation

@utkrishtsahu
Copy link
Contributor

@utkrishtsahu utkrishtsahu commented Oct 6, 2025

feat: Add comprehensive DPoP (RFC 9449) support across all platforms

This commit implements full DPoP (Demonstrating Proof of Possession) support
for the auth0-flutter SDK across Web, Android, and iOS platforms, enhancing
security by cryptographically binding access tokens to clients.

📦 Dependencies Updated

  • Android: com.auth0.android:auth0:3.10.0
  • iOS/macOS: Auth0:2.14.0, JWTDecode:3.3.0, SimpleKeychain:1.3.0
  • Web: @auth0/[email protected]

✨ New Features

Web Platform

  • Upgraded Auth0 SPA JS SDK from v2.0 to v2.9.0 with unpkg CDN
  • Added useDPoP constructor parameter to Auth0Web class
  • Implemented SDK loading verification with timeout handling
  • Added comprehensive error handling and logging

Android Platform

  • Upgraded Auth0.Android SDK from v3.9.0 to v3.10.0
  • Implemented reflection-based DPoP enablement for WebAuthProvider
  • Added fallback mechanisms for different SDK versions
  • Enhanced plugin initialization with proper context management

iOS/macOS Platform

  • Upgraded Auth0.Swift SDK from v2.10.0 to v2.14.0
  • Upgraded JWTDecode from v3.2.0 to v3.3.0
  • Upgraded SimpleKeychain from v1.2.0 to v1.3.0
  • Updated all podspec files (darwin/, ios/, macos/)

📚 Documentation

  • Added comprehensive DPoP section to README.md (~184 lines)
  • Included usage examples for all platforms (Web, Android, iOS)
  • Added configuration requirements and troubleshooting guide
  • Documented platform-specific features and API usage
  • Added links to RFC 9449 and Auth0 documentation

🧪 Testing

  • Added 17 DPoP-specific tests for mobile platforms (30 total)
  • Added 21 DPoP-specific tests for web platform (68 total)
  • Fixed test exception type mismatches (WebException)
  • All 122 tests passing across all platforms

🔧 Technical Changes

Build Configuration

  • Upgraded Android Gradle to 8.4.0
  • Upgraded Java compatibility to version 17
  • Upgraded Kotlin JVM target to 17
  • Updated compileSdk to 35

🔐 Security Enhancements

  • Token theft prevention through cryptographic binding
  • Replay attack protection with fresh DPoP proofs
  • Cross-platform security consistency
  • Automatic DPoP proof generation by native SDKs

🚀 Platform Support

  • ✅ Web: Full DPoP support with SPA JS SDK 2.9.0
  • ✅ Android: Full DPoP support with Auth0.Android 3.10.0
  • ✅ iOS: Full DPoP support with Auth0.Swift 2.14.0
  • ✅ macOS: Full DPoP support with Auth0.Swift 2.14.0

@arpit-jn
Copy link
Contributor

@claude

@github-actions

This comment has been minimized.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

val builder = api.userInfo(request.data["accessToken"] as String)
val accessToken = request.data["accessToken"] as String
val tokenType = request.data["tokenType"] as? String ?: "Bearer"
val builder = api.userInfo(accessToken)
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to pass the token type to the api.userInfo(accessToken, tokenType)

builder.addParameters(request.data["parameters"] as Map<String, String>)
}

builder.addHeader("Authorization", "$tokenType $accessToken")
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to add the header here. the android native client will take care of it

let tokenType = arguments[Argument.tokenType] as? String ?? "Bearer"

client
.userInfo(withAccessToken: accessToken)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as android , tokenType should be passed here to the userInfo call
client .userInfo(withAccessToken: accessToken,tokenType)

client
.userInfo(withAccessToken: accessToken)
.parameters(parameters)
.headers(["Authorization": "\(tokenType) \(accessToken)"])
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this headers here

@utkrishtsahu utkrishtsahu merged commit d0ab5d2 into main Dec 10, 2025
11 of 13 checks passed
@utkrishtsahu utkrishtsahu deleted the DPoP_upport_flutter branch December 10, 2025 05:16
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.

5 participants