edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/social_core/backends
SECRET = 'client secret'
PUBLIC_KEY = 'publick key from keycloak'
AUTHORIZATION_URL = 'http://localhost:8080/auth/realms/myrealm/protocol/openid-connect/auth'
ACCESS_TOKEN_URL = 'http://localhost:8080/auth/realms/myrealm/protocol/openid-connect/token'
USER_DETAILS_URL = 'http://localhost:8080/auth/realms/myrealm/protocol/openid-connect/userinfo'
"THIRD_PARTY_AUTH_BACKENDS":[
"social_core.backends.keycloak.KeycloakOAuth2",
"social_core.backends.google.GoogleOAuth2",
"social_core.backends.linkedin.LinkedinOAuth2"
]
在Django管理应用程序中,添加了一个提供程序
Name: Keycloak
slug: keycloak
site: localhost:81
backend: keycloak
client Id: 'mooc'
Client Secret: 'secret key'
还在lms.auth.json中添加了客户端秘密
"SOCIAL_AUTH_OAUTH_SECRETS": {
"keycloak":"14f89ef1-02ff-48ad-825f-8160e515ec8e"
}
在Keycloak客户端设置中,添加了访问类型“机密”,并重定向uri“http://localhost:81/auth/complete/Keycloak/”
[Sat Apr 18 17:09:21.212377 2020] [:error] [pid 8143] Traceback (most recent call last):
[Sat Apr 18 17:09:21.212419 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
[Sat Apr 18 17:09:21.212442 2020] [:error] [pid 8143] response = get_response(request)
[Sat Apr 18 17:09:21.212462 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
[Sat Apr 18 17:09:21.212485 2020] [:error] [pid 8143] response = self._get_response(request)
[Sat Apr 18 17:09:21.212506 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
[Sat Apr 18 17:09:21.212526 2020] [:error] [pid 8143] response = self.process_exception_by_middleware(e, request)
[Sat Apr 18 17:09:21.212548 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
[Sat Apr 18 17:09:21.212569 2020] [:error] [pid 8143] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Sat Apr 18 17:09:21.212589 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/utils/decorators.py", line 185, in inner
[Sat Apr 18 17:09:21.212610 2020] [:error] [pid 8143] return func(*args, **kwargs)
[Sat Apr 18 17:09:21.212630 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
[Sat Apr 18 17:09:21.212651 2020] [:error] [pid 8143] response = view_func(request, *args, **kwargs)
[Sat Apr 18 17:09:21.212671 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/social_django/utils.py", line 49, in wrapper
[Sat Apr 18 17:09:21.212697 2020] [:error] [pid 8143] return func(request, backend, *args, **kwargs)
[Sat Apr 18 17:09:21.212720 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/social_django/views.py", line 23, in auth
[Sat Apr 18 17:09:21.212742 2020] [:error] [pid 8143] return do_auth(request.backend, redirect_name=REDIRECT_FIELD_NAME)
[Sat Apr 18 17:09:21.212762 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/social_core/actions.py", line 29, in do_auth
[Sat Apr 18 17:09:21.212783 2020] [:error] [pid 8143] return backend.start()
[Sat Apr 18 17:09:21.212803 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/social_core/backends/base.py", line 35, in start
[Sat Apr 18 17:09:21.212823 2020] [:error] [pid 8143] return self.strategy.redirect(self.auth_url())
[Sat Apr 18 17:09:21.212844 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/social_django/strategy.py", line 88, in redirect
[Sat Apr 18 17:09:21.212864 2020] [:error] [pid 8143] return redirect(url)
[Sat Apr 18 17:09:21.212884 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/shortcuts.py", line 56, in redirect
[Sat Apr 18 17:09:21.212904 2020] [:error] [pid 8143] return redirect_class(resolve_url(to, *args, **kwargs))
[Sat Apr 18 17:09:21.212925 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/shortcuts.py", line 147, in resolve_url
[Sat Apr 18 17:09:21.212945 2020] [:error] [pid 8143] return reverse(to, args=args, kwargs=kwargs)
[Sat Apr 18 17:09:21.212965 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/src/django-wiki/wiki/models/__init__.py", line 90, in reverse
[Sat Apr 18 17:09:21.212986 2020] [:error] [pid 8143] url = original_django_reverse(*args, **kwargs)
[Sat Apr 18 17:09:21.213006 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/urls/base.py", line 91, in reverse
[Sat Apr 18 17:09:21.213026 2020] [:error] [pid 8143] return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
[Sat Apr 18 17:09:21.213047 2020] [:error] [pid 8143] File "/opt/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/urls/resolvers.py", line 497, in _reverse_with_prefix
[Sat Apr 18 17:09:21.213067 2020] [:error] [pid 8143] raise NoReverseMatch(msg)
[Sat Apr 18 17:09:21.213089 2020] [:error] [pid 8143] NoReverseMatch: Reverse for 'None?scope=profile+email&state=yst8UI8KZihrluHg9R0oUFexFIx0QYGM&redirect_uri=http%3A%2F%2Flocalhost%3A81%2Fauth%2Fcomplete%2Fkeycloak%2F%3Fredirect_state%3Dyst8UI8KZihrluHg9R0oUFexFIx0QYGM&response_type=code&client_id=mooc' not found. 'None?scope=profile+email&state=yst8UI8KZihrluHg9R0oUFexFIx0QYGM&redirect_uri=http%3A%2F%2Flocalhost%3A81%2Fauth%2Fcomplete%2Fkeycloak%2F%3Fredirect_state%3Dyst8UI8KZihrluHg9R0oUFexFIx0QYGM&response_type=code&client_id=mooc' is not a valid view function or pattern name.
在查找和阅读了许多官方资源后,我还没有找到任何有效的解决方案。所以我决定尝试自己的KeyCloak自定义文件。
下面是文件https://github.com/ranjeet692/python-social-auth-keycloak的链接,
对于打开的edx用户,将此文件放入/edx-ironwood.2-6/apps/edx/venvs/edxapp/lib/python2.7/site-packages/social_core/backends目录中
按照Social Auth文档中提到的rest指令操作
并重新启动服务器。您应该可以使用KeyCloak登录。
读取用户登陆信息 调用地址 https://secure.bilibili.tv/login 参数 字段 必选 类型 说明 api true string 申请时填入的API地址 appkey true string 申请时系统提供的Key sign true string 校验密钥 md5(“api=“) 回调 编码为UTF-8 返回值字段 字段类型 字段说明 mid int 会员编号 unam
1.如何获取APPID和APPSECRET这两个参数? 1.需登录微信开放平台配置,具体可参考使用手册。 2.申请QQ互联申请链接 2.升级以后,微信浏览底部图标不显示,应该检查哪里? 后台店铺手机端底部导航设置
在我的Web应用程序中,我想在新选项卡中打开第三方Web服务器页面。我通过使用下面的来源实现了这一点。 现在我想通过提供用户名和密码将用户登录到这个第三方网站。单一登录概念在这里是不可能的,因为第三方web获得了不同的身份验证和令牌策略。因此,这样做的结果是将用户登录到第三方web服务器,而不允许用户向应用程序输入登录凭据。 感谢任何帮助,谢谢。
我正试图通过一个第三方库登录我的meteor站点,比如下面的库:https://gist.github.com/gabrielhpugliese/4188927 在server.js中,我有: PS.在服务器端,users集合看起来很好。流星令牌和其他一切都在那里。
对于用户而言,注册账号密码是一件非常麻烦的事情,不但注册过程繁琐且花时间,同时也提高了用户的账号维护成本。因此如果网站能够提供第三方登录,让用户能够直接复用一些现有且常用的网站账号,将能够大大提高用户体验。 接入第三方登录 API 一些大型的站点平台都会开放相应的第三方登录接口和说明文档,如国内的有: 百度账号接入指南:http://developer.baidu.com 新浪微博接入指南:htt
第一步,商城启用微信前台登陆,需要在Niushop商城后台设置->基础设置->第三方登陆,进入到微信配置界面。 我们可以看见需要配置APPID和APPSECRET,如何获取这两个参数? 第二步,登录微信开放平台,找到管理中心->网站应用->创建网站应用, 按照流程,填写基本信息->填写网站信息->提交成功,等待审核即可。 注意:填写回调域名只需填写网站域名即可。 第三步,在网站应用 查看申请应用的