FormidableLabs / FormidableLabs/react-native-app-auth

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

Open
#921 2 comments 1 reaction 0 assignees View on GitHub
help wanted needs-triage
Dominant language
Java
Stars
2.3k
Forks
473
PR merge metrics
No merged PRs in 30d

Description

## 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: ,
redirectUrl: "myapp://myclient/redirect",
serviceConfiguration: {
authorizationEndpoint: `${domainName}/oauth2/authorize`,
tokenEndpoint: `${domainName}/oauth2/token`,
revocationEndpoint: `${domainName}/oauth2/revoke`,
endSessionEndpoint: `${domainName}/logout`
},
additionalParameters: {
identity_provider: ,
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](https://github.com/FormidableLabs/react-native-app-auth/assets/22350063/836d210d-061a-4bad-95cf-c3bf51a4efc9)

---

## 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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.