Click here to Skip to main content
15,036,145 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to integrate google login in my ASP.NET website application..

I googled and ended up getting following help on http://loginwithgoogle.codeplex.com

1) Register your application into Google to have client ID and client secrete key
a. For basic understating about Google API
i. https://developers.google.com/accounts/docs/OAuth2#basicsteps
b. For Registering your application
i. Login here
1. https://accounts.google.com/ServiceLogin?service=devconsole&passive=1209600&continue=https://code.google.com/apis/console/&followup=https://code.google.com/apis/console/
ii. Here is how to setup
c.

i.
2) Download source code
3) Update web.config file’s application setting keys
4) Upload code into your domain, it will not work with localhost
5) in sample application, I have not used any 3rd part dll, it is pure java script base authentication
6) Google is returning, user data in JSON format, I have used simple string functions to manipulate it, but you can use proper JSON string parser.
7) In this sample you will get Google ID, Email, first Name and Last Name

I got ClientID, Client secret key etc., even I've downloaded Jason code.. but not being able to use that code.. also it asks me to change my web.config settings(not getting exactly what to change in web.config)

I just want to know what code I should add on Gconnect(used on my Login form) button to serve 'login with your google' a/c

Please Help Thanks in advance
Posted
Updated 29-Jul-13 0:53am
v2
Comments
[no name] 29-Jul-13 6:29am
   
You would need to go back to http://loginwithgoogle.codeplex.com and ask them.

1 solution

Open the downloaded folder. Open the web.config XML configuration file. You will find something like below code.
XML
<appSettings>
    <add key="google_clientId" value="xxxxxxxx.apps.googleusercontent.com" />
    <add key="google_clientEmail" value="xxxxxxxxxx@developer.gserviceaccount.com" />
    <add key="google_clientSecret" value="xxxxxxxxxxxx" />
    <add key="google_RedirectUrl" value="http://YOUR-DOMAIN.com/LoginWithGoogle1.aspx" />
    <add key="google_JavaScriptOrigin" value="http://YOUR-DOMAIN.com" />
  </appSettings>

This is what you have to change.

Regards..:laugh:
   
Comments
sameer.pantvaidya 29-Jul-13 8:15am
   
Thanks Rohan.. but it will be better if u can further help me out with complete solution..
Thanks7872 29-Jul-13 8:31am
   
It is long process so cant be directed here. Everything is ready with the code you downloaded. Follow the procedure as suggested in pdf document,it will definitely work.
sameer.pantvaidya 29-Jul-13 8:39am
   
okay sure.. thanks for the above help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900