Socialauth API 4.3 与 Google Oauth 2.0 [英] Socialauth API 4.3 with Google Oauth 2.0

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

问题描述

有谁知道如何在带有 Google Oauth 2.0 的 servlet 中使用 Brickred Socialauth API 4.3?我在哪里可以获得 *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 wiki 上提供的说明不再有效.以下应该工作假设:

The instructions available on the BrickRed wiki no longer work as you have already found out. The following should work assuming:

A.您正在使用 socialauth 4.2+.我用 socialauth 4.4 测试了这些.
B. 您正在尝试配置自己的域,而不是使用砖块域进行测试.
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

  1. 首先在 Google Cloud Console 上注册您的应用程序:
    一种.转到 https://cloud.google.com/console/project
    湾登录
    C.创建一个新项目
    d.API &身份验证 > 凭据
    e.创建新的客户端 ID(应用程序类型:Web 应用程序,授权重定向 URL:http://YOUR_HOST_NAME/socialauth.html)
  2. 修改brickred properties.xml
    替换
    <prop key="www.google.com.consumer_key">opensource.brickred.com</prop>
    <prop key="www.google.com.consumer_secret">YC06FqhmCLWvtBg/O4W/aJfj</prop>



    <prop key="googleapis.com.consumer_key">在上述步骤 1.e 中创建的客户 ID</prop>
    <prop key="googleapis.com.consumer_secret">在上述步骤 1.e 中创建的客户端密钥 </prop>

如果你没有使用 Spring,请修改 oauth_consumer.properties

If you are not using Spring, modify oauth_consumer.properties

修改您的应用程序中用户单击以启动联系人导入过程的链接:
改变
?id=google

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 与 Google Oauth 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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