MaikuB / flutter_appauth

A Flutter wrapper for AppAuth iOS and Android SDKs
274 stars 246 forks source link

PlatformException(authorize_and_exchange_code_failed, Failed to authorize: [error: null, description: Unable to parse ID Token] #536

Closed gg-circlesarrows closed 2 months ago

gg-circlesarrows commented 2 months ago

currently getting this error

PlatformException (PlatformException(authorize_and_exchange_code_failed, Failed to authorize: [error: null, description: Unable to parse ID Token], {code: 8, error_description: Unable to parse ID Token, root_cause_debug_description: org.json.JSONException: Value �"���&��B of type java.lang.String cannot be converted to JSONObject, user_did_cancel: false, type: 0, error: null, error_uri: null, legacy_error_details: Value �"���&��B of type java.lang.String cannot be converted to JSONObject, error_debug_description: AuthorizationException: {"type":0,"code":8,"errorDescription":"Unable to parse ID Token"}}, null))

my code is

final TokenResponse? token = await _appAuth.authorizeAndExchangeCode(
        AuthorizationTokenRequest(
          _clientId,
          _redirectUrl,
          serviceConfiguration: const AuthorizationServiceConfiguration(
            tokenEndpoint: tokenUrl,
            authorizationEndpoint: authorizeUrl,
            endSessionEndpoint: revokeUrl,
          ),
          scopes: [
            'openid',
            'email',
            'https://api.customers.com/auth/customer.graphql',
          ],
          preferEphemeralSession: true,
          promptValues: [
            'login',
          ],
        ),
      );