diff --git a/lib/flutter_auth0_client.dart b/lib/flutter_auth0_client.dart index 6d25efe..de94a80 100644 --- a/lib/flutter_auth0_client.dart +++ b/lib/flutter_auth0_client.dart @@ -34,6 +34,7 @@ class FlutterAuth0Client { final String audience; final String? scheme; final bool useEphemeral; + final bool detailedResponse; FlutterAuth0Client({ required this.clientId, @@ -42,6 +43,7 @@ class FlutterAuth0Client { this.scope = "", this.audience = "", this.useEphemeral = false, + this.detailedResponse = false, }); Future login() async { @@ -54,7 +56,8 @@ class FlutterAuth0Client { "scope": scope, "audience": audience, "useEphemeral": useEphemeral, - "scheme": scheme + "scheme": scheme, + "detailedResponse": detailedResponse, }); final decodedJson = jsonDecode(rawJson); return Auth0Credentials.fromJSON(decodedJson); diff --git a/lib/flutter_auth0_client_web.dart b/lib/flutter_auth0_client_web.dart index f550788..5a708e7 100644 --- a/lib/flutter_auth0_client_web.dart +++ b/lib/flutter_auth0_client_web.dart @@ -59,7 +59,7 @@ class FlutterAuth0ClientWeb { scope: args['scope'], audience: args['audience']); } final token = await client.getTokenSilently( - detailedResponse: true, audience: args['audience']); + detailedResponse: args['detailedResponse'], audience: args['audience']); Map tokenMap = { 'accessToken': token.accessToken, 'idToken': token.idToken, @@ -67,4 +67,6 @@ class FlutterAuth0ClientWeb { }; return jsonEncode(tokenMap); } + + }