【发布时间】:2018-07-27 13:10:41
【问题描述】:
您好,我有 SPA(单页应用程序),我使用 oauth2 隐式授权进行授权。作为身份服务器,我有 Wso2 身份服务器 5.4.1。
我能够授权该应用程序,并且一切正常 - 我还配置为跳过同意。
问题来了: 我正在尝试通过以下链接在 .../oauth2/authorize 服务和属性 prompt=none 的帮助下以静默方式重新验证登录用户:
https://xxx:9447/oauth2/authorize?response_type=id_token token&nonce=123&prompt=none&client_id=xxxx&scope=openid&redirect_uri=http://localhost:63342/myapp/www/index.html&id_token_hint=previous_user_token
这里写的 promp=none:
http://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint 我应该能够在用户登录并将同意配置为跳过或始终批准时对其进行身份验证。
但我总是在 URI 中得到同样的错误:
http://localhost:63342/myapp/www/index.html#error_description=Authentication+required&error=login_required&session_state=state124124125125.1251512
【问题讨论】:
-
我猜 WSO2 使用 cookie 作为会话标识符,您是否检查过
/authorize请求发送的 cookie 是否正确? -
也许你必须在 header 上传递 client_id 和 secret ?
-
@Max 不,客户端密码是您不存储在 SPA 应用程序客户端的内容。这将是不安全的
-
或者,您可以使用 signinSilent()。检查:stackoverflow.com/a/63609654/6363952
标签: authentication oauth-2.0 wso2