Micronaut Swagger redirect not working with OAuth 2 with Authorization code + PKCE

Viewed 1060

I am using swagger open API 3 in the Micronaut application with Authorization + PKCE flow as below

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")}
                ))
)

The client_id and client_secret are not mapped and I don't know how can I map, currently I am putting it manually.

When the Open Id redirect to the Identity provider, I am able to perform successful authentication.

Now, when the Identity provider redirects back to the micronaut swagger UI, the redirect URI is http://localhost:8084/oauth2-redirect.html which can't be found in the Micronaut Swagger and I can't call any end point because it doesn't contain access_token

I think the micronaut swagger should have a URI https://localhost:8084/swagger/oauth2-redirect.html and the Identity provider should redirect to this URL.

0 Answers
Related