-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHP] Laravel improvements #462
Comments
👍 for the first suggestion. I am not too familiar with Laravel's I don't like the idea of using a 3rd-party library to abstract away all implementation details of oauth providers in this specific case. The only reason I was able to write so many backend examples, when I am only comfortable with Node.js, is because the flow is exactly the same, regardless of which language or server-side framework you are using. Another advantage is that it could be used as a learning resource, because it isn't a black box like passport.js, omniauth, socialite. There used to be a |
I understand about the 'black box' thing, but isn't that pretty much the same for users using sattelizer? If they wanted to do the whole process manually, they wouldn't need to use sattelizer ;) |
I see your point. Both arguments are valid, in one case it is explicit and easy to understand, in another case it is short & simple and "don't care how it works,I just want it to work". I'll think about it, meanwhile I would appreciate that PR for the new Laravel middleware. |
@barryvdh I'd love to see an example of Socialite and JWT playing nice together with something like GitHub authentication. |
I'll see if I can put up an example or blog post about it soon :) |
@barryvdh That'd be amazing! Thanks :) |
@barryvdh Thanks +1, by the way, with this method, Auth::check() or Auth::user() doesn't work. How can I make JWT play nicely with Laravel, and if you can guide us more on the Socialite integration, I'd be grateful :) |
You may have a look at this tutorial, which shows the use of JWTs within Laravel and Angular: I forked the repository from @chenkie and added Socialite support to it: Maybe you want to have a look at it, @barryvdh. |
Can you check out http://barryvdh.nl/laravel/lumen/angular/2015/07/19/oauth-in-javascript-apps-with-angular-lumen-using-satellizer-laravel-socialite/ ? I've written about these changes. Let me know if something is unclear, so I'll fix it before I |
Barry , thanks. I was looking for using Socialite with Satellizer! By the On Sunday, July 19, 2015, Barry vd. Heuvel notifications@github.com wrote:
Ali Gajani |
Yes |
Hi! Just started implementing Satellizer + Socialite. I am getting a server error with Socialite. ClientException in Middleware.php line 69: I am trying to implement Google authentication. Any suggestions to debug this error? Thanks in advance. |
Catch the exception and print the response body. |
Thanks @barryvdh. Sorry about the trouble. I had my route set to "any" verb instead of only "post". This resolved the issue with Socialite on the server side. Your article http://barryvdh.nl/laravel/lumen/angular/2015/07/19/oauth-in-javascript-apps-with-angular-lumen-using-satellizer-laravel-socialite/ is fantastic. Thanks for the help. |
Thanks for this project! Here are some improvements for Laravel. If you want I can PR them:
$this->auth->onceUsingId($payload['sub']);
If you create a new middleware (eg.
jwt
) you can use both thejwt
middleware and regularauth
middleware. In the controllers, you can just doAuth::check()
andAuth::user()
.For OAuth2, it's something like this for every provider:
OAuth1 is a bit different, but can get the same Profile information:
This will make it a lot simpler to add more drivers :)
Common pitfalls:
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
The text was updated successfully, but these errors were encountered: