Access swagger-ui after setup to initialize oauth2
See original GitHub issueIs there an existing issue that is already proposing this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe it
It is not possible to initialize ouath2 parameters.
Looking at the doc https://swagger.io/docs/open-source-tools/swagger-ui/usage/oauth2/
ui.initOAuth({
clientId: "your-client-id",
clientSecret: "your-client-secret-if-required",
realm: "your-realms",
appName: "your-app-name",
scopeSeparator: " ",
scopes: "openid profile",
additionalQueryStringParams: {test: "hello"},
usePkceWithAuthorizationCodeGrant: true
})
Describe the solution you’d like
Either SwaggerModule.setup() should return an instantiated swagger-ui or we should add configuration option that could trigger the setup of ui.initOauth()
.
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
Cannot pre configure oauth2 configuration such as clientId.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Swagger UI OAuth 2.0 configuration
You can configure OAuth 2.0 authorization by calling the initOAuth method. ... Method can be called in any place after calling constructor SwaggerUIBundle ......
Read more >How to do OAuth2 Authorization in ASP.NET Core for ...
NET Core for Swagger UI using Swashbuckle ... To enable OAuth2 authentication, first we need to write the following code.
Read more >How to configure oAuth2 with password flow with Swagger ui ...
The best way so far to work with oAuth2 Authorisation is by using Swagger Editor, I have installed Swagger Editor quickly in Docker...
Read more >ASP.NET Core Swagger UI Authorization using IdentityServer4
To configure the Swagger UI as a client application in your IdentityServer implementation, you'll need to add a client entry within ...
Read more >Keycloak Integration – OAuth2 and OpenID with Swagger UI
As we can see, both the service provider and the service consumer need to contact the Keycloak server. First, we'll need to install...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can achieve this with
swaggerOptions
Does anybody else find swagger to be just incredibly messy and have a terrible DX.
I almost always advocate for GraphQL purely because of how annoying Swagger is to configure.
Prime example…
Why is there a function initOauth()
But for some reason, you don’t pass the
redirectUrl
in this part… instead you configure it in the parent swagger options config? asoauth2RedirectUrl
Like come on.