Question

I am currently trying to implement Google's OAuth 2.0 for Login in my PHP application : so far I have been able to achieve ** this **.

I have registered the application on Google API Console and got the necessary parameters to be used for the OAuth 2.0 APIs from Google .

I was wondering which one would be the best option to implement? Object oriented approach using Google APIs Client Library for PHP OR Google's OAuth 2.0 for Login?

What are the benefits of using Client Library over direct Online API or vice-versa? I am looking for a long term maintainable code. So please answer by keeping this in mind and if possible the pros and cons of both approaches.

Thanks.

Was it helpful?

Solution

Looks to me like what you're doing is working, so what's the problem? Presumably the PHP library has lots of other stuff beyond the simple OAuth login; if you need that stuff, then you should probably use that library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top