Laravel 5 Socialite package won't get downloaded by composer ?
Hello guys,
I was trying to pull socialite package by composer but it gives some errors
Problem 1
- laravel/socialite v1.0.3 requires illuminate/contracts ~4.3 -> no matching package found.
- laravel/socialite v1.0.2 requires illuminate/contracts ~4.3 -> no matching package found.
- laravel/socialite v1.0.1 requires illuminate/contracts ~4.3 -> no matching package found.
- laravel/socialite v1.0.0 requires illuminate/contracts ~4.3 -> no matching package found.
- Installation request for laravel/socialite ~1.0 -> satisfiable by laravel/socialite[v1.0.0, v1.0.1, v1.0.2, v1.0.3].
Besides the package error, i do have some questions about Sign up and Login via Facebook or Twitter !
Sign Up
After the user has been redirected to my app after getting the code, do i have to save access token in db ? and make a random password ?
and if the token has expired, how can i get new access token ?
Login
In the login process i just have to verify the email that been gathered by the access token ? if so, i should logged him ?
Sorry guys for these noob questions, because this is still not really clear for me !
You do not have to save the access_token, it may change at each new request and is only valid for a limited time [often 1h]. On the same way, you do not have to check password as it is done by your social provider [this is social login objective]
Socialite will use provider's email a unique ID and will create a user in your local DB before it returns. This model is hardcoded and not easy to overload. If like in my own case this pattern does not respond to your need, you're in trouble. Socialite model based on email cannot work with Yahoo or Orange that do not return user's email, or even with GitHub that return a fake Email.
I'm not suggesting anything I only responded to your question about access_token. What ever toolkit you will use, the access_token may change every hours or so, and for sure at each connection. That's part of OAUTH spec and Socialite cannot change it. For your question about 4.2, I'm not the best placed. I started Laravel with L5 and I stop using Socialite because of it limitations.
Do I have an other social login module ? yes but for L5! You can check demo and code from http://oidconnect.breizhme.net/ The social login part is quite independent of Laravel and should be easy to port on anything running PHP. But the access control part rely on Middleware, that I think are new to L5. I also extended Auth class and I'm not sure how much of this was already available in L4.