Skip to content

Auth URL Variables #33

Open
Open

Description

@michaelmerrill

Currently we can set the server variables for different environments like so:

servers:
  - url: 'https://{environment}.example.com/v1'
    variables:
      environment:
        default: api
        enum:
          - api
          - sandbox.api
          - development.api
          - staging.api

Is it possible to also set variables for the authorization code urls? Normally you'd want to match these environments when authenticating. I'd imagine it would look something like this:

securitySchemes:
  OAuth2:
    type: oauth2
    flows:
      authorizationCode:
        authorizationUrl: 
          - url: 'https://{environment}.example.com/authorize'
            variables:
              environment:
                default: accounts
                enum:
                  - accounts
                  - sandbox.accounts
                  - development.accounts
                  - staging.accounts
        tokenUrl: 
          - url: 'https://{environment}.example.com/token'
            variables:
              environment:
                default: accounts
                enum:
                  - accounts
                  - sandbox.accounts
                  - development.accounts
                  - staging.accounts

Activity

  1. hkosova commented on Aug 21, 2020

    @hkosova

    Related (or duplicate): OAI/OpenAPI-Specification#551

  2. MikeRalphson commented on Aug 21, 2020

    @MikeRalphson
    Member
  3. handrews commented on May 13, 2026

    @handrews
    Member

    I think the only thing to figure out here is issue #31, which is about where to put the auth servers and how to reference them (if they are not exclusively inline). Once we have Server Objects for auth servers, variables come with it automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions