Skip to content

Required String parameter 'client_id' is not present Error during logout #921

Open
@only1chi

Description

@only1chi

Issue

I am trying to signout a user with the logout function. I am using Amazon cognito which is our IDP.
It is enabled for I enabled 'Sing Out Idp Flow' as suggested by AWS documentation.

I successfully login with auth configuration as follows:

  const config =  {
        clientId: <our client id>,
        redirectUrl: "myapp://myclient/redirect",
        serviceConfiguration: {
          authorizationEndpoint: `${domainName}/oauth2/authorize`,
          tokenEndpoint: `${domainName}/oauth2/token`,
          revocationEndpoint: `${domainName}/oauth2/revoke`,
          endSessionEndpoint: `${domainName}/logout`
        },
        additionalParameters: {
                identity_provider: <our identity provider>,
                client_id: <our client id>
              }
      };

When we want to logout, we call the logout endpoint as follows:

        const response = await logout(config, {
          idToken: currentIdToken,
          postLogoutRedirectUrl: config.redirectUrl
        }).catch(e => {
          const { code, message, userInfo } = e;
          console.log("logout error: ", { message, code, userInfo });
        });

The logout works partially in the sense that it successfully logs out the user from the IDP. However, it seems to get stuck somewhere between the logout and the redirect.
We get a message saying:
Required String parameter 'client_id' is not present

And the app is stuck on that a screen.
We have provided client_id as an additional parameter. I don't understand why it is not supplied to the logout endpoint.
Any ideas on how to resolve this?

Screenshot_20231109_170451_Chrome


Environment

  • Your Identity Provider: e.g. IdentityServer Azure (using AWS Cognito)
  • Platform that you're experiencing the issue on: both
  • Your react-native Version: 0.71.11
  • Your react-native-app-auth Version: 7.1.0
  • Are you using Expo? No

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedAssistance or domain expertise requiredneeds-triageWaiting for a member of the team to confirm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions