PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, November 1, 2022

[FIXED] How to implement google oauth in cakephp using cakedc/users?

 November 01, 2022     cakedc, cakephp, google-authentication, oauth-2.0     No comments   

Issue

I am trying to add a login layer using CakeDC/users plugin using linkedin and google. The linkedin login is working fine, but I am not able to figure out google login. Followed everything in the tutorial login with google oauth

I am getting a code parameter in url returned from google/auth but the value of a parameter authuser is returned as 0.

On developers.google site I found that if code parameter is being returned the app is authenticated.

No user is being added to the users table as well as no change takes place in social_accounts table as well and a flash message is displayed as 'You are not authorized to access that location.'


Solution

In order to get Google OAuth working you need to generate an OAuth 2.0 Client ID under credentials (https://console.developers.google.com/).

Then you need to enable Google+ API under Control Panel (This is the step you probably missed). If you don't enable the API, Google won't return user details and you will experience the behavior you described.



Answered By - ajibarra
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing