skip to Main Content

I have a scenario where I have to sign in as google and Facebook using rest API(laravel) in a flutter. I don’t know How it can be done. Is it possible or not? Please provide me some guidelines

2

Answers


  1. My favorite Laravel login authentication is: Laravel Socialite

    See here:
    https://github.com/overtrue/laravel-socialite

    This one will work with Laravel 7/8 versions.

    Login or Signup to reply.
  2. The process would involve making use of another package. This works using a 2 legged Oauth approach.

    1. Set up the Facebook/Google SDK on Flutter. You will need this for the first part.
    2. Use the socialite library to exchange the token you get from the OAuth step on the client side (Flutter) to the server side.
    3. You can then retrieve the owners information including the email.
    4. If the email is already on your server then you can trust they are who they are and log them in (return an access token as though they logged in using username and password)
    5. If they are not on you database already, you can return some information back to the client and ask them to complete their registration or you can trust that they are a legitimate user and register them silently.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search