Google API集成 [英] Google API integration

查看:95
本文介绍了Google API集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的ASP.NET网站应用程序中集成谷歌登录..



我用Google搜索并最终得到以下http://loginwithgoogle.codeplex.com



1)将您的申请注册到Google以获取客户ID和客户分泌密钥

a。关于Google API的基本知识

i。 https://developers.google.com/accounts/docs/OAuth2#basicsteps

b。注册申请表

i。登录这里

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。以下是如何设置

c。



i。

2)下载源代码

3)更新web.config文件的应用程序设置键

4)将代码上传到你的域名,它不会使用localhost

5)在示例应用程序中,我没有使用任何第三部分dll,它是纯java脚本基础身份验证

6)Google正在返回,用户数据在JSON格式,我使用简单的字符串函数来操作它,但你可以使用正确的JSON字符串解析器。

7)在这个示例中,您将获得Google ID,电子邮件,名字和姓氏



我有ClientID,客户端密钥等,即使我已下载Jason代码..但无法使用该代码..它也要求我更改我的web.config设置(无法准确地在web.config中更改)



我只想知道我应该在Gconnect上添加哪些代码(在我的登录表单中使用) )按钮服务'用你的谷歌登录'a / c



请提前帮助谢谢

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

推荐答案

打开下载的文件夹。打开web.config XML配置文件。你会发现类似下面的代码。

Open the downloaded folder. Open the web.config XML configuration file. You will find something like below code.
<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:


这篇关于Google API集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆