我有一个用于Web登录的OKTA客户端(单页面应用程序,带有PKCE的授权代码流)。我的重定向URI使用http,而不是https。现在,在重定向到OKTA进行身份验证之前,我在浏览器中看到一个错误:
core.js:6210 ERROR Error: Uncaught (in promise): AuthSdkError: PKCE requires a modern browser with encryption support running in a secure context.
The current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol.
AuthSdkError: PKCE requires a modern browser with encryption support running in a secure context.
The current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol.这显然建议使用https而不是http。这是唯一的解决办法吗?或者有办法解决这个问题?它考虑到我的应用程序的开发环境,所以它不需要超级安全。(编辑)
发布于 2022-11-24 08:42:46
也许SDK中有一个设置,允许您在不使用HTTPS的情况下使用PKCE?PKCE规范不要求在发送挑战和代码时使用HTTPS。实际上,引入PKCE是因为在移动环境中,OAuth请求和响应部分不被TLS保护,并且从浏览器到应用程序的响应不受保护。
如果无法在SDK中更改它,则可以使用openssl工具创建自签名证书,并将应用程序设置为即使在本地主机上也使用HTTPS (您将从浏览器获得有关证书的警告,但至少它将运行HTTPS)。
https://stackoverflow.com/questions/74557587
复制相似问题