question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging in as different user fails

See original GitHub issue

Issue

My app stores tokens on the device after login, and does logout by clearing device storage. However when I try to login again as a different user, after entering the credentials in the browser instance I get the message

You are already authenticated as different user 'foo@bar.com' in this session. Please logout first.

Clearing the browser cache solves the problem. Is there anything I’m missing to properly handle logout?


Environment

  • Your Identity Provider: Keycloak
  • Platform that you’re experiencing the issue on: iOS and Android
  • Are you using Expo? No

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

7reactions
expouiccommented, Dec 6, 2019

I try to call end_session_endpoint of my keycloak and i have success to logout user.

http://keycloakhost:keycloakport/auth/realms/{realm}/.well-known/openid-configuration

Change {realm} with your realm configuration and you have the url to execute the fetch.

example: http://keycloakhost:keycloakport/auth/realms/{realm}/protocol/openid-connect/logout?id_token_hint=your_keycloak_token

6reactions
tensor5commented, Dec 9, 2019

Here is what I do

const body = new URLSearchParams({
      client_id: Config.CLIENT_ID,
      refresh_token
    }).toString()

fetch(`${Config.ISSUER}/.well-known/openid-configuration`)
  .then(res => res.json())
  .then(openidConfig => fetch(
    openidConfig.end_session_endpoint,
    {
        body,
        headers: {
            Authorization: `Bearer ${accessToken}`,
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: 'POST'
    }
))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging on a user account fails - Windows Server
This article solves an issue where logging on a user account that's a member of more than 1,010 groups fails. Applies to: Windows...
Read more >
Unable to sign in when Run as different user
Run as different user (one with elevated DB access) sign in fails. Visual Studiowindows 10.0visual studio 2019 version 16.1.6. Pinned.
Read more >
Fix Other User Login Screen - YouTube
Login screen says other user how do I fix? Can't log in, Other User. I show you how to fix Other User on...
Read more >
“Other User” Windows Login Problem - NeoSmart Technologies
Cause 1: Corrupted user profiles in registry · Cause 2: TDSS/Alureon virus infection · Cause 3: Deleted user profiles · Cause 4: FlipShare...
Read more >
How to Fix User Profile Cannot be Loaded in Windows 10?
If the error The User Profile Service failed the sign-in appears when you first log in to the computer under a new account,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found