Uday Singh
11/18/2025, 9:01 AMConverting object to an encodable object failed: Instance of DescopeSession , i want to utilize the native features of mobile app like biometric, also my app is running in webview (react app), is there is any to achieve that?Uday Singh
11/18/2025, 9:05 AMRahul Rijhwani
11/18/2025, 9:23 AMRahul Rijhwani
11/18/2025, 9:28 AMDescopeSession object instead of just the JWT string.
Solution:
Extract the session JWT from the Descope session and pass it to your WebView:
final sessionJwt = Descope.sessionManager.session?.sessionJwt;
if (sessionJwt != null) {
// Pass sessionJwt to your WebView
}
For your React app in the WebView:
Once you have the sessionJwt, you can inject it into your WebView using JavaScript channels or by appending it as a URL parameter/header when loading your web app. Your React app can then use this token for API requests.
Using native biometric authentication:
You can authenticate users with passkeys (which leverage biometric authentication) in your Flutter app, then pass the resulting session token to your WebView:
final authResponse = await Descope.flow.start(options);
final session = DescopeSession.fromAuthenticationResponse(authResponse);
Descope.sessionManager.manageSession(session);
// Extract and pass the JWT
final sessionJwt = session.sessionJwt;
Your React app can then use this token by setting it in request headers for backend authentication.
Reference doc: https://github.com/descope/descope-flutter/blob/main/README.md
https://docs.descope.com/getting-started/flutter/goUday Singh
11/18/2025, 9:56 AMconst { isAuthenticated, isSessionLoading, sessionToken, claims } = useSession();
// useUser retrieves the logged in user information
const { user, isUserLoading } = useUser();Uday Singh
11/18/2025, 9:57 AMUday Singh
11/18/2025, 9:58 AMUday Singh
11/18/2025, 10:00 AMRahul Rijhwani
11/18/2025, 10:07 AMUday Singh
11/18/2025, 10:13 AMUday Singh
11/18/2025, 10:18 AMsession.sessionJwt will expire by some time? after some time i've to reshare the token to webview, i want to share only at one time at time of running the webflow after, i want to use
const {sessionToken } = useSession();
maybe setting cookies same as mobile app will help? or there is other way?Rahul Rijhwani
11/18/2025, 11:05 AMUday Singh
11/18/2025, 11:05 AMRahul Rijhwani
11/18/2025, 11:12 AMUday Singh
11/19/2025, 7:06 AMRahul Rijhwani
11/19/2025, 7:07 AMUday Singh
11/19/2025, 7:46 AMRahul Rijhwani
11/20/2025, 6:09 AMUday Singh
11/20/2025, 8:55 AMRahul Rijhwani
11/20/2025, 10:20 AMRahul Rijhwani
11/20/2025, 4:47 PMItai Hanski
11/20/2025, 5:19 PMUday Singh
11/24/2025, 6:03 AMUday Singh
11/24/2025, 6:04 AMRahul Rijhwani
11/24/2025, 7:19 AM