Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I have a microservice with endpoints secured using OAuth 2.0. The service runs in three different servers/environments (Local, Dev, and SIT), and each environment uses a different authorization server with its own Auth URL, Access Token URL, etc. Is there a way to define a single security schema that can adjust these URLs automatically based on the selected server/environment?

You must be logged in to vote

Replies: 1 comment · 9 replies

Comment options

tokenUrl and its friends can be indicated in the OAD as a uri-reference. This should be resolved against the the canonical uri of the OAD itself, which in 3.1.x is only provided to the implementation out-of-band as a retrieval uri ("the URL where this document was found") but in 3.2 the $self property is being added for the document itself to state what its identifier should be (and if that is also a uri-reference, that's resolved against the "retrieval uri").

Server urls in the root, path-item object and operation object already exist, but I believe these would only be used for processing the runtime request's URI (e.g. to match a request to the appropriate /paths/* entry in the document), not security URIs.

You must be logged in to vote
9 replies
@handrews
Comment options

handrews Sep 7, 2025
Collaborator

@karenetheridge This is all my interpretation, btw. That doesn't necessarily mean it's correct.

@karenetheridge
Comment options

This could probably use a clarification then. I'm looking through the schema at all the uri-references, and some of them seem intuitively that they'd resolve against the OAD itself with the retrieval uri and $self (e.g. jsonSchemaDialect, /info/termsOfService) and some against an http request at runtime, but I don't think the revisions for 3.2 about URIs differentiates between the two types.

@karenetheridge
Comment options

I put up my initial thoughts here - #4926

@handrews
Comment options

@karenetheridge it should be possible to fully determine the behavior of all fields from the definitions given in the sections on resolving API description URIs and API URLs.

Anything that is part of interacting with the API (including potentially-3rd-party services like auth servers) is an API URL. Anything that needs to be resolved in order to use the entire OpenAPI Description is an API Description URI and resolved against a base URI per RFC3986 (which is not necessarily the retrieval URI, even if $self is absent). Combining server URL templates and path templates involves special rules, but those are explicitly defined. Is there anything that does not fit in these categories?

@handrews
Comment options

@karenetheridge I'm not disputing that it may need clarification and there may be some things mis-categorized or unclear, just trying to figure out what isn't covered by the existing definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
security security: config The mechanics of severs and structure of security-related objects
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.