iFrame integration, issue logging out users


#1

Im facing an issue logging out users.
I’m using the iFrame integration on my site.
I use an admin account to get tokens for users to log them in, this way I do not need to deal with passwords.

  1. The iFrame API URL isn’t always called. So I cannot return an empty token to signify that the user is not logged in.(Probably cached.)
  2. I use the userId and the user auth_token and call the /api/v1/logout endpoint (vs using the admin token to log them out).

When I try to log out the user calling the end point, even thought I get a status success message, he is still logged into the server.

Maybe Im doing it wrong, but the flow via logs that I took seems to be correct. Everything seems to be working as it should, it’s just the user never actually gets logged out.

Side Note: If I’m able to log users in as an Admin via tokens, shouldn’t I be able to log them out as an Admin? I couldn’t find that endpoint if it exists. As of now I understand that I can get the user token as an Admin, but the user himself needs to logout.


#2

I just wanted to update on how i Fixed this issue that I had. It was an issue with the way that I was doing it. Thank you

There was an issue with users that I was logging in/out with. I guess I expected the Logout endpoint to invalidate all tokens. So while I was logging in with different browsers there were two tokens valid that were registered with the server.

Just for reference I have added the endpoints that I am using for this.

Login:
Endpoint: /api/v1/users.createToken
Header: X-Auth-Token: ADMIN_AUTH_TOKEN
Header: X-User-Id: ADMIN_USER_ID
Data: ‘{ “userId”: “USER_ID” }’

Logout:
Endpoint:* /api/v1/logout*
Header: X-Auth-Token: USER_AUTH_TOKEN
Header: X-User-Id: USER_ID