swagger-api / swagger-api/swagger-ui

Allow configuration of Authorization tokenURL

Open
#5,751 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Content & configuration

Using openapi: 3.0.2 yaml I want to make the tokenURL configurable. Even just let the user edit it.

Swagger/OpenAPI definition:

openapi: 3.0.2
info:
 title: Demo
 version: '1.0'
servers:
 - url: '/api'
   description: Internal API (relative path)
security:
 - OAuth2: []
paths:
 /hello:
   get:
     summary: Your GET endpoint
     operationId: getHello
     responses:
       '200':
         description: OK
       '400':
         description: Bad Request
       '401':
         description: Unauthorized
components:
 securitySchemes:
   OAuth2:
     type: oauth2
     description: This API uses OAuth 2
     flows:
       clientCredentials:
         tokenUrl: "{protocol}://{server}:{port}/auth/realms/system/{tenant}/openid-connect/token"
         scopes: {}

Currently the user cannot change the tokenUrl:

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by loading the supplied OpenAPI 3.0.2 YAML in Swagger UI and inspect the OAuth2 authorization form shown in the issue. Trace how the client-credentials tokenURL is presented, then make it configurable or editable and verify that the configured value is used for authorization.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.