Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oauth 2: Javascript vs. PHP?

I want to add "login with XYZ" capability to one of my web apps. I don't need any of the advanced stuff - just logging users in with one of their existing profiles so they don't have to remember yet another login credentials set.

After some research, I found HybridAuth and hello.js.

I know Javascript as well as PHP, but I have never implemented OAUTH 2 support before.

From what I can see, I could technically imagine implementing the identification and authentification both in Javascript or in PHP.

What would you recommend I choose, and why?

like image 525
Swiss Mister Avatar asked Nov 09 '22 07:11

Swiss Mister


1 Answers

Since no comment or answer really answered my question, I'll answer with the additional reading I have been doing. I hope it will help if you arrived here via your research into the same question.

Having to use your "client secret" requires an OAUTH 2 client to have some server-side code (I don't want to have my "secret" in client-side JS, do i...). Hello.js solves this via a OAUTH Proxy.

Since I prefer to minimize my dependencies on third parties in production, I'd much rather use PHP in the first place.

Therefore, I will be implementing with hybridauth for now.

like image 101
Swiss Mister Avatar answered Nov 14 '22 21:11

Swiss Mister