【发布时间】:2018-02-27 03:21:25
【问题描述】:
我正在尝试使用 Auth0 为 wordPress 和我自己的应用程序中的话语执行 SSO。下面提到了流程。
Image added here (low on rep) so cant post
用户在应用程序中输入用户名和密码,详细信息被发送到服务器,服务器使用 auth0 API 对用户进行身份验证并发回令牌。
我已经在 Discourse 中安装了来自 GitHub 的 auth0 SSO 插件 2,并且所有客户端 ID、客户端密码都添加到了插件中。
当我登录到我的应用程序时,我想知道在 Discourse 的情况下由谁执行 SSO。
对于 WordPress 使用的是以下方法。
<form *ngIf="userService.isAuthenticated()" ngNoForm action="http://xx.xx.xx.xx/index.php?auth0=implicit&client_id=xxxxxxxxxxxxxxxxxxxxxxxxx&connection=xxxxxxxxxx"
method="post">
<input class="hidden" type="text" id="token" name="token" value="{{tokenValueIsHereReturnedbyAuth0Authentication}}" />
<input class="hidden" type="text" id="redirect_to" name="redirect_to" value="http://xx.xx.xx.xx/index.html" />
<input class="btn btn-primary pull-right" type="submit" value="View" />
</form>
那么如何在话语中做类似的事情呢?
我已经尝试了以下
但是我无法完成,因为我不知道是什么
https://somesite.com/sso?sso=PAYLOAD&sig=SIG
PAYLOAD 和 SIG 是
更新:
我认为的有效载荷:Auth0 给我的 access_token 是有效载荷,它被编码为Base64(使用:base64encode dot org),而 SIG 是有效载荷的 HMAC-SHA256 哈希,使用 sso_secret 作为密钥和 Base64编码的有效载荷
(freeformatter dot com slash hmac-generator)
【问题讨论】:
标签: angularjs wordpress single-sign-on auth0 discourse