swagger-api / swagger-api/swagger-ui

Add support to authorize by using POST method JSON via REST API

Open
#5,441 4 comments 21 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Among all REST API methods available to Swagger UI, my Spring Boot application exposes REST API method to authenticate user on:

http://localhost:8080/api/authenticate with JWT token as a result of successful login.

Is there any way to configure Swagger UI to use this logics, instead of authorizing manually and pasting apiKey JWT token by hand?

Swagger UI should provide authorization form with username and password, pass those as JSON to API via POST method, grab JWT token and store it as apiKey automatically.

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 with the /api/authenticate REST endpoint and the Swagger UI authorization flow described in the issue, including the username/password JSON request and JWT response. Done means Swagger UI can submit those credentials through POST, capture the returned JWT, and use it as the apiKey without manual pasting.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, spring-boot
Domain
api, authentication, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.