Micronaut Swagger 重定向不适用于带有授权代码 + PKCE 的 OAuth 2

问题描述

我在 Micronaut 应用程序中使用 swagger open API 3,授权 + PKCE 流程如下

enter image description here

@SecurityScheme(name = "Open Id Connect",type = SecuritySchemeType.OAUTH2,scheme = "bearer",bearerFormat = "jwt",flows = @OAuthFlows(
                authorizationCode = @OAuthFlow(
                        authorizationUrl = "https://dev-6271510.okta.com/oauth2/default/v1/authorize",tokenUrl = "https://dev-6271510.okta.com/oauth2/default/v1/token",refreshUrl = "",extensions ={@Extension(name = "client_id",properties = {@ExtensionProperty(name = "client_id",value = "ssssss")})},scopes = {@OAuthScope(name = "openid",description= "Open Id scope"),@OAuthScope(name = "profile",description= "Name scope"),@OAuthScope(name = "email",description= "Email scope")}
                ))
)

client_id 和 client_secret 没有映射,我不知道如何映射,目前我手动放置。

当 Open Id 重定向到身份提供商时,我能够成功执行身份验证。

现在,当身份提供者重定向回 micronaut Swagger UI 时,重定向 URI 是 http://localhost:8084/oauth2-redirect.html,在 Micronaut Swagger 中找不到,我无法调用任何端点,因为它没有包含access_token

我认为 micronaut swagger 应该有一个 URI https://localhost:8084/swagger/oauth2-redirect.html,身份提供者应该重定向到这个 URL。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...