Mono Support Google Login does not work (Closed)

Viewed 16124 time(s), 6 post(s), 11/18/2013 1:33:23 PM - by bkkmono
11/18/2013 1:33:23 PM
434 Reputation 51 Total posts

Hello,

I am trying to set up Social Login in my MonoX website, I could do this successfully with Facebook Login and Twitter Login, but not for Google Login.

I registered my application in Google API Project to create my own Client ID and Client Secret, they come with OAuth 2.0 Client ID version and everything is OK. My Client ID looks like this form: 23123123.apps.googleusercontent.com, then I added them in web.config like this: 

<add WrapperName="GoogleWrapper" ConsumerKey="23123123.apps.googleusercontent.com" ConsumerSecret="client secret key" AdditionalScopes="https://www.googleapis.com/auth/userinfo.profile" />
But I got an error when I tried to login using Google Login in the page Login.aspx, the message shows like this: 
"Unable To Connect To Specified Social Network   Invalid Request Token received.Provider returned: openid.ns"

Additionally, I also changed WrapperName from GoogleWrapper to GoogleHybridWrapper, but not work.

How should I do to resolve this problem?



1
11/18/2013 1:45:18 PM
15993 Reputation 2214 Total posts

This should be fixed / implemented in the latest MonoX nightly build. We will provide you with more information soon.

Regards

2
11/18/2013 3:19:40 PM
2218 Reputation 300 Total posts

Hello,

When you upgrade to the latest nightly build you need to make a few changes in your solution:
1. In the web.config edit the AdditionalScops for GoogleWrapper, ex:

<add  WrapperName="GoogleWrapper" ...  AdditionalScopes="openid profile email" />
2. On the Google API Console ensure that the Web Origin setting matches your domain URI as for the Redirect URI we recommend that you use the following URI setting: http://mysiteurl.com/socialauth/validate.sauth

Regards,
Mario

3
11/18/2013 3:48:12 PM
434 Reputation 51 Total posts

Thanks for your answer, MZILIC but I don't still get it.

What is openid profile email?

What is http://mysiteurl.com/socialauth/validate.sauth ?

Please explain me more.

4
11/18/2013 3:57:58 PM
2218 Reputation 300 Total posts

What is openid profile email?
These are Google OAuth 2.0 scopes. Please refer Google API for more information: https://developers.google.com/accounts/docs/OAuth2Login

This is the URI where Google sends its response and socialauth/validate.sauth is the SocialAuth handler which handles that response. More information about the redirect URI is available on the page I mentioned above as well.

Regards

5
11/20/2013 10:55:02 AM
434 Reputation 51 Total posts

Thank you.
After I upgraded my site to the latest nightly version of MonoX and changed Redirect URI on Google Consent Screen to http://mysiteurl.com/socialauth/validate.sauth as your suggestion, I could successfully login to my site with my Google account.

6
This is a demo site for MonoX. Please visit Mono Software for more info.