refactor: expose swagger UI to enable OAuth2 try-it-out in upstream applications #1250
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is a Proof-of-Concept to attempt a fix to some issues in an upstream repository (
konnect-portal
). The issue is that for client-side-only OIDC "Try It Out" authorization, one needs to be able to initialize oauth with certain values available.More info!
For SPA-based requests to the
/authorize
endpoint, one needs to invoke the following (whereswaggerUI
is an instance that has already been initialized.Rather than initializing that within
spec-renderer
(really withinswagger-ui-web-component
), I think the better move is to allow more flexibility and to expose#instance
so that folks can call it from the consuming application.Open to differing opinions, this is just how we got things working for our use case: https://gist.github.com/andrewwylde/d47c94c7629a81a0232ac80ef862e788