在 Okta 中配置变量回调 URI

Configure variable callback URI in Okta

我正在尝试使用回调 URL 配置一个新的 Okta 应用程序,这将取决于租户的子域。这意味着我需要同一个 Okta 应用程序来接受重定向(使用 redirect_uri 参数)到 https://0001.my.domain.com/oauth2/callbackhttps://0002.my.domain.com/oauth2/callback 等等。注意 00010002 子域。这可能看起来很奇怪,但这是为了演示目的。重点是避免必须为每个租户设置不同的 Okta 应用程序。

Okta 自己的docs on the subject阅读:

Does your Initiate Login URI vary by tenant? — If Yes, enter which part of the Initiate Login URI is customizable. For example, the subdomain in https://<subdomain>.example.com/signin/.

但是,当我尝试这样做时,我 运行 遇到了一个错误,抱怨说:

The redirect URIs must be absolute URIs.

也许我只是读错了,但我认为这意味着支持 variables/placeholders。

我搜索了 Okta 文档的其余部分,但未找到有关该主题的其他信息。

如果 Okta 让您这样做,它就不会符合 OAuth 2.0。

https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics-16#section-2.1:

When comparing client redirect URIs against pre-registered URIs, authorization servers MUST utilize exact string matching except for port numbers in "localhost" redirection URIs of native apps.