-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify OAuth 'realm' #3406
Comments
* Factored out URL handling code into function processUrl * Call processUrl in places where we use authorizationUrl and tokenUrl * Removed tiny bit of redundant code in auths.jsx * Set default/example realm name to 'your-realm' (singular) instead of 'your-realms' (plural) as this parameter is supposed to be singular afaik * Improved documentation for 'realm' in README.md Fixes swagger-api#3406 See also swagger-api#1424
Same issue here. We have a development, staging and production environment. Each with its own realm. But the swagger.yml is always the same and points to exactly one of these three realms by the 'authorizationUrl'. Making it configurable in some way would be great. |
I actually implemented a PR for this. See the referenced #3410 |
When waiting for the PR to be merged, as a workaround I can suggest to setup a backend endpoint that would accept realm name as an input and perform adjustment of the name in the swagger document. |
There's a feature request OAI/OpenAPI-Specification#551 to support parameters in |
I am using the latest version of Swagger UI (cloned from master yesterday 👍 ). I love Swagger it is fantastic. I use it for testing as well as documentation.
I have been setting up authorization using OAuth2 with Keycloak as the backend. It's a rocky ride due to fragmented / outdated / missing documentation but I got things to work. But there is this one thing I can't wrap my head around.
In my swagger.json I have a securitydefinitions section that looks like this:
In the index.html file, I made some changes to set the URL of the definition and the oauth redirect URL, like so:
This shows my API as expected with an Authorize button at the top. When I press it I get the dialog as expected. The client ID is prefilled as I like it and when I hit the button I go to my login page and all is well.... As long as I make sure I configure everything in the
master
realm on Keycloak.As you can see the config has a field for
realm
and it's actually set to'myrealm'
. However when I configure stuff in Keycloak under'myrealm'
, it does not work. It has to be under the'master'
realm.I figure this is because Keycloak mentions the realm in the path part of the authorization / token URLs:
I can of course change these URLs in the definition. But it would be much nicer imho if the definition could be independent of the actual auth implementation, same as is done for
clientId
.So finally, my question / feature request:
Is it possible to specify a parameter in the URL where
realm
should be filled in?Something like this perhaps?:
If this stuff is in the docs then sorry for bothering you. I did search, I swear! 👍
EDIT:
I just found this related closed issue:
#1424
The text was updated successfully, but these errors were encountered: