Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth.logout() does not send token for proper logout from IDP #168

Open
gibsonf1 opened this issue Sep 13, 2020 · 0 comments
Open

auth.logout() does not send token for proper logout from IDP #168

gibsonf1 opened this issue Sep 13, 2020 · 0 comments

Comments

@gibsonf1
Copy link

gibsonf1 commented Sep 13, 2020

The auth.logout() is not sending the token to the Solid server which we need for identifying the user for proper logout.

The code in question is here:

export async function logout(
  storage: AsyncStorage,
  fetch: Function
): Promise<void> {
  const rp = await getStoredRp(storage)
  if (rp) {
    try {
      // First log out from the IDP
      await rp.logout()
      // Then, log out from the RP
      try {
        await fetch('/.well-known/solid/logout', { credentials: 'include' })
      } catch (e) {
        // Ignore errors for when we are not on a Solid pod
        // But tell users it is harmless because they will see the GET failure in the console
        console.info(
          "Couldn't find /.well-known/solid/logout, this is harmless."
        )
      }
    } catch (err) {
      console.warn('Error logging out of the WebID-OIDC session')
      console.error(err)
    }
  }
}

the rp.logout() does hit the IDP correctly, but without credentials, so the next call in this code to then use .well-known/solid/logout is not called as the IDP call returns a 401.

Any idea why rp.logout() is not including credentials?

@gibsonf1 gibsonf1 changed the title auth.logout() does not send token for proper logout from RP auth.logout() does not send token for proper logout from IDP Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant