Topic-icon Google+ login Error: redirect_uri_mismatch

Active Subscriptions:

None
10 years 5 months ago #38696 by chitop
Issue when logging in to site with Google+ credentials.
When I try to login to my site (www.mychicatopia.com/coachella) with Google+, it redirects me to Google at this URL: accounts.google.com/ServiceLogin?

service=lso&passive=1209600&continue=https://accounts.google.com/o/oauth2/auth?scope%3Dhttps://www.googleapis.com/auth/plus.me

%2Bhttps://www.googleapis.com/auth/userinfo.email%26response_type%3Dcode%26access_type%3Doffline%26redirect_uri%3Dhttp://mychicatopia.com/coachella/index.php?option

%253Dcom_jfbconnect%2526task%253Dauthenticate.callback%2526provider%253Dgoogle%26approval_prompt%3Dauto%26state%3Dec6f6b9076106c4d4c32833797b7c647%26client_id

%3D765378605058.apps.googleusercontent.com%26hl%3Den%26from_login%3D1%26as%3D-

304ce86339951a23&ltmpl=popup&shdf=CnwLEhF0aGlyZFBhcnR5TG9nb1VybBoADAsSFXRoaXJkUGFydHlEaXNwbGF5TmFtZRoOY2hpY0Bjb2FjaGVsbGEMCxIGZG9tYWluGg5jaGljQGNvYWNoZWxsYQwLEhV0aGlyZ

FBhcnR5RGlzcGxheVR5cGUaB0RFRkFVTFQMEgNsc28iFCCRkIv5GhvuzkVaZzLe_nO6LLffKAEyFGZGFgBFSVmUPU-2zbzmFlS-18V5&sarp=1&scc=1
Once I type my credentials I get the following error:
Error: redirect_uri_mismatch

The redirect URI in the request: mychicatopia.com/coachella/index.php?opt...back&provider=google did not match a registered redirect URI

Learn more

Request Details
from_login=1
cookie_policy_enforce=false
scope=https://www.googleapis.com/auth/plus.me www.googleapis.com/auth/userinfo.email
response_type=code
access_type=offline
redirect_uri=http://mychicatopia.com/coachella/index.php?option=com_jfbconnect&task=authenticate.callback&provider=google
state=9e0be1d40bfd1c77310c9b0422a5cb72
as=6c0a74a128a4a337
display=page
client_id=765378605058.apps.googleusercontent.com
hl=en


I followed the directions here to setup my account: www.sourcecoast.com/jfbconnect/docs/soci...le-application-setup

Because the actual URL to my this particular site where I'm using JFBconnect to authenticate via Google+ is www.mychicatopia.com/coachella and not

www.mychicatopia.com, the Redirect URI I'm using is as follows:
mychicatopia.com/coachella//index.php?op...back&provider=google
www.mychicatopia.com/coachella//index.ph...back&provider=google

Could you tell my what I'm doing wrong?
The topic has been locked.
Support Specialist
10 years 5 months ago #38707 by alzander
The two Redirect URI's you mention you're using have two slashes before the index.php (coachella//index.php). That doesn't look correct.

Fix that, and hopefully things will work as expected.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 5 months ago - 10 years 5 months ago #38720 by chitop
I realized I used the two forward slashes when I posted the question, but that was a mistake when posting the question, in reality on the Google configuration it only has on slash.
It is still not working, any other ideas?
Last edit: 10 years 5 months ago by chitop.
The topic has been locked.
Support Specialist
10 years 5 months ago #38730 by alzander
No, then, actually. In the long error message you posted above, the URL we're passing to Google is:

redirect_uri%3Dhttp://mychicatopia.com/coachella/index.php?option %253Dcom_jfbconnect%2526task%253Dauthenticate.callback%2526provider%253Dgoogle

When parsed out, that becomes:

mychicatopia.com/coachella/index.php?opt...back&provider=google

That URL is also what Google is stating needs to be set in their later error explanation.

If that's not working, then all I can suggest is checking the following:
* You've properly copied the Google App ID and Secret Keys to JFBConnect.
* The Callback URL is setup correctly and *exactly* like the url above. One letter off, or even an extra space, will cause it to fail.
* Try creating a new Google+ Application altogether and re-set it up. It's possible there's just something wrong with your app.

We haven't heard of this problem before when configured correctly, but will gladly help to continue diagnosing however we can. Let us know how the above goes.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 5 months ago #38735 by chitop
I created a new Google+ application like you suggested.
I even used a different Google account.
I double-checked and made sure there are no space on the Redirec URI, the Client ID, or the Client Secret. I also made sure there are no spaces at the beginning or at the end.
I'm getting the same error. Could it be because Google made some changes on their side, and the directions found here (www.sourcecoast.com/jfbconnect/docs/soci...le-application-setup) are no longer current?
There must be something small I'm missing.
I'm attaching a screenshot of my Web Origin and Redirect URI.

File Attachment:
The topic has been locked.
Support Specialist
10 years 5 months ago #38757 by alzander
That's a new issue to us then. The things you posted above all seem correct. At this point, can you do the following so we can check out all of your settings:
* In the Google Console area, go to "Permissions" and click "Add Member". Add "This email address is being protected from spambots. You need JavaScript enabled to view it." as "Can Edit"
* Private message me your super admin credentials by clicking the mail icon under my name to the left.

We'll get in to both areas and check out what may be going wrong.

Thanks,
Alex
The topic has been locked.
Support Specialist
10 years 5 months ago #38876 by alzander
Very sorry for not getting you an answer sooner. It took a bit of investigation to figure out the problem. The cause is the new 'Cloud Console' layout is incorrectly truncating the Callback URIs that are saved there. So, instead of:

mychicatopia.com/coachella/index.php?opt...back&provider=google

It was saving:

mychicatopia.com/coachella/index.php?option=com_jfbconnect

That's not correct, and therefore throws the error.

To fix, in the bottom of the cloud console there is a little grey link that says "Return to original console". I clicked that link and edited your app the 'old' way. The Callback URI was properly saved and things seem to work now.

Please test and let me know how that goes.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 5 months ago #38911 by chitop
That did it.
It works.
Thank you.
The topic has been locked.
Support Specialist
10 years 5 months ago #38914 by alzander
Glad to hear that got you going. Should you need anything else, just let us know.

Finally, if you haven't already, please consider leaving a rating and review for JFBConnect, or our support, on the Joomla Extension Directory. It certainly isn't required, but is very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks,
Alex
The topic has been locked.