Socialauth API 4.3与谷歌的Oauth 2.0 [英] Socialauth API 4.3 with Google Oauth 2.0
问题描述
有谁知道如何使用Brickred Socialauth API 4.3在Servlet中与谷歌的Oauth 2.0吗?
我在哪里可以得到* CONSUMER_SECRET *和* CONSUMER_KEY *?
Does anyone know how to use Brickred Socialauth API 4.3 in servlets with Google Oauth 2.0? Where could I get the *consumer_secret* and *consumer_key*?
使用API成功的在你身边了?
Was using the API successful at your side?
推荐答案
在BrickRed维基使用的指令不再工作,因为你已经发现了。下面应该工作假设:
The instructions available on the BrickRed wiki no longer work as you have already found out. The following should work assuming:
一个。您正在使用socialauth 4.2以上版本。我socialauth 4.4测试了这些。
B.你尝试配置自己的域名,而不是使用测试brickred域。
C.你正在创建一个Web应用程序,否则相应地调整
A. You are using socialauth 4.2+. I tested these with socialauth 4.4.
B. You are trying to configure your own domain and not using the brickred domain for testing.
C. You are creating a web application, else adjust accordingly
- 先注册你的谷歌云控制台上的应用:
一个。转到 https://cloud.google.com/console/project
湾登录
C。创建一个新项目
ð。 API和放大器;验证>凭据
即创建新的客户端ID(应用程序类型:Web应用程序,授权重定向网址:HTTP://YOUR_HOST_NAME/socialauth.html
)
- 修改brickred properties.xml中
更换<支撑键=www.google.com.consumer_key> opensource.brickred.com< /道具>
<支撑键=www.google.com.consumer_secret> YC06FqhmCLWvtBg / O4W / aJfj< /道具>
与
<支撑键=googleapis.com.consumer_key>在上述&lt步骤1.E创建客户端ID; /道具>
<支撑键=googleapis.com.consumer_secret>客户秘密上述&lt步骤1.E创建; /道具>
- First register your application on Google Cloud console:
a. Go to https://cloud.google.com/console/project
b. Login
c. Create a new project
d. APIs & Auth > Credentials
e. Create New Client ID ( Application Type: Web Application, Authorized redirect URL:http://YOUR_HOST_NAME/socialauth.html
) - Modify brickred properties.xml
Replace
<prop key="www.google.com.consumer_key">opensource.brickred.com</prop>
<prop key="www.google.com.consumer_secret">YC06FqhmCLWvtBg/O4W/aJfj</prop>
with
<prop key="googleapis.com.consumer_key">CLIENT ID created in Step 1.e above</prop>
<prop key="googleapis.com.consumer_secret">Client Secret created in Step 1.e above </prop>
如果你不使用Spring,修改oauth_consumer.properties
If you are not using Spring, modify oauth_consumer.properties
修改链接在你的应用程序,其中用户点击来启动通讯录导入过程:
改变?ID =谷歌
Modify the link in your application where the user clicks on to start the contacts import process:
change
?id=google
到
?ID = GOOGLEPLUS
希望这有助于
这篇关于Socialauth API 4.3与谷歌的Oauth 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!