PHP 的 Okta 登录小部件不起作用

Okta sign-in widget with PHP does not work

我尝试使用给定的示例应用程序设置 OAuth 工作流 here

但是由于某种原因,在我输入我的 okta 用户 ID 和密码后,我再也无法通过回调 URL 取回控制权并且应用程序会无限期地挂起。

然而,正常的 Javascript Singn-in 小部件(检查此 link)和最少的身份验证确实有效,我将控制权返回给重定向 URL。 但这不适用于 OAuth2 工作流程...这对我来说完全没用。 因为它所做的只是使用 Okta 租户应用程序提供身份验证服务,它会将您重定向到您的应用程序 URL。这不提供任何授权授予工作流或其他 OAuth2 复杂工作流。可能对某些应用程序有用,但对您想要检索用户配置文件并根据从 OKTA 检索的用户配置文件数据创建登录会话的企业应用程序没有用。

So my question is why is the OAuth workflow not working using the PHP application that uses JS sign-in-widget? And why there are no instructions or warning on this page for this costly service (this is not free and many org is probably paying for this)?

我花了将近一天的时间按照 link 上的说明设置我的授权服务器,但没有任何效果。知道肯定出了什么问题吗?

Does this entire example works only after contacting OKTA support to enable the Authorization server feature? Because, I also saw a documentation here that says that this is Early Access (EA) feature (and it is probably recently added in OKTA? Extremely frustrating experience).

顺便说一句,我向他们的客户支持发送了电子邮件以启用此授权服务器功能,以防万一我遗漏了什么。如果这不起作用,那么我将不得不使用 Laravel 5.4 PHP 框架创建我自己的 OAuth2 服务器,这可能是最快的解决方案并且 100% 免费。

我还尝试按照提供的说明测试授权服务器设置 here。 我成功地使以下终点工作:

/oauth2/:authorizationServerId/.well-known/openid-configuration

但我无法使用 api 端点获得任何范围和声明:

/api/v1/authorizationServers/:authorizationServerId/scopes

简而言之,到目前为止,我无法测试我的授权服务器以使我的授权授予工作流程正常工作。

Where can I look for some troubleshooting advice?

Is there another way to check whether I have configured my OKTA Authorization server properly?

我发现为 PHP 示例提供的 JS 脚本不适合我正在处理的工作流程。所以在更改那个 JS 脚本之后,事情开始起作用了。

编辑:另请注意,设置授权服务器是 OKTA 中的一项新功能(这是早期访问功能)。默认情况下不启用。因此,您需要联系 OKTA 支持团队以启用授权服务端点及其提供的功能。