Laravel Sanctum with Socialite API
(Updated on 23/9/2022 : Flutter app updated)
Hello everyone, this is my first post on DEV.to.
In this post, I ...
For further actions, you may consider blocking this person and/or reporting abuse
Great article, I really need this.
Also, thanks for sharing the Flutter app.
@philipdroubi , Do I need to create a Google app to get client_id and client_secret ?
And does this work with Facebook, Github and other providers??
@rober You're welcome.
1- As a backend you don't need to create any google app, frontend should do.
2- Yes it works, But you need to edit your
config/services.php
file to be like this :And the
validateProvider
function inSocialiteController
to be like this :You saved my day.
Cheers mate!
My pleasure! 😃
where can i find the access_provider_token ?
The redirect is not obligatory?
@229okpe
You can get the access_provider_token for testing purpose through this flutter app or through this website.
And remember that as an API the frontend application must send the access_provider_token through the request.
No need for any redirect.
is there no providers table to know which this user comes from google ,GitHub or Facebook ??
and how mobile developer sends me access_token_provider in callback ??
@ahmedali190000
1- Yes, of course, if you want to store from which provider each user came from, you must have a
providers_table
.2- Mobile developers can send you the
access_token_provider
in the request parameters or body, but if you mean the token itself it's better to send it using the request body as it may be too long to be in the request parameters.Bro!, Thank you!
@keyvervelasquez You're welcome.