firebase / firebase-admin-go

Firebase Admin Go SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to revoke a session old when to do new login?

renanbastos93 opened this issue · comments

How can I get sessions of a specific user and, in some way, be able to revoke any of these sessions?
I'm trying to do that because I need to keep just two sessions alive per user.
My goal is to revoke the oldest session if the user starts a new one.

I am so sorry my English is not so good. Case you don't understand I will try to explain again.

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Hi @renanbastos93 are you looking a way to do this on server side using Firebase Admin SDK?

@lahirumaramba
Hi!

Yeah, but I don't want to use other services like Redis, SQL, etc. I would like to use only the firebase/GCP identity.

see ya

You can't logout a user remotely via the Admin SDK, if that's what you are trying to solve. The logout should happen from the client side. See more about Managing User Sessions on: https://firebase.google.com/docs/auth/admin/manage-sessions

There is also a similar question on SO: https://stackoverflow.com/questions/53087895/how-to-force-logout-firebase-auth-user-from-app-remotely

In the future, please use StackOverflow for usage questions. Thank you!

@lahirumaramba thanks a lot for helping me.

FYI: @BrenoAndrade @PatrickChagasTavares @akmissawa @helciofrancotc