How to integrate Facebook Login in Xamarin forms without Logging out

1.6k Views Asked by At

I am planning to use Facebook for user authentication in Xamarin forms.

I read that Facebook doesn't allow refresh tokens, so how to keep the session alive unless the user explicitly signs out.

1

There are 1 best solutions below

1
Sunny On BEST ANSWER

I found a way to tackle this. The login can be validated using Web Authenticator.

https://learn.microsoft.com/en-us/xamarin/essentials/web-authenticator?tabs=android#using-webauthenticator

Once user is validated, generate a custom JWT/oAuth token and use this token for the authorization instead. Delete it when user explicitly signs out, so it will again follow normal validation process.