step-up-labs / firebase-authentication-dotnet

C# library for Firebase Authentication
MIT License
376 stars 129 forks source link

Refresh Token Implementation #217

Open rsemihkoca opened 4 months ago

rsemihkoca commented 4 months ago

I am having difficulty finding the refresh token section in the documentation.

I have an application where I sign-in and sign-up with just email and password.

I can get IdToken and refresh token using the signinwithemailpasswordasync method.

I want to be able to return a new idtoken and refresh token thanks to the "/refresh" endpoint. Before doing this, I want to check whether the previous Idtoken and refresh token are valid. Pseudo code:

signinwithemailandpassword -> Idtoken1, refreshtoken1

/refresh endpoint (Idtoken1, refreshtoken1) check (Idtoken1 is valid) check (refreshtoken1 is valid) like user id matches or expires_in is valid

and return new IdToken2 and refresh token2

I use default in memory as repository. It is not necessary for me to store credentials right now. I want to open PR if I can solve the current problem