MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Google Login does not work (Closed) (Mono Support )

Viewed 14598 time(s), 6 post(s) 11/18/2013 1:33:23 PMby bkkmono
bkkmono

bkkmono

11/18/2013 1:33:23 PM
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?



This content has not been rated yet. 
434 Reputation 51 Total posts
khorvat

khorvat

11/18/2013 1:45:18 PM
This should be fixed / implemented in the latest MonoX nightly build. We will provide you with more information soon.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
mzilic

mzilic

11/18/2013 3:19:40 PM
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
This content has not been rated yet. 
2218 Reputation 300 Total posts
bkkmono

bkkmono

11/18/2013 3:48:12 PM
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.
This content has not been rated yet. 
434 Reputation 51 Total posts
mzilic

mzilic

11/18/2013 3:57:58 PM
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
This content has not been rated yet. 
2218 Reputation 300 Total posts
bkkmono

bkkmono

11/20/2013 10:55:02 AM
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.
This content has not been rated yet. 
434 Reputation 51 Total posts