Skip to content

Accessing protected APIs in Swagger

Karthik Pillai edited this page Sep 29, 2021 · 5 revisions

1. Swagger endpoints

Access the available endpoints at

http://localhost:8080/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config

2. Register User

account-resource -> POST /api/register

3. Activate User

  • Go to MySQL database and select all the users in table 'jhi_user'
  • Copy the activation_key for the registered user
  • Activate the user by going to Swagger

account-resource -> GET /api/activate

4. Generate JWT for Accessing the protected endpoints

user-jwt-controller -> POST /api/authenticate

  • Enter the username & password
  • Send POST request
  • Copy the JWT

5. Using the JWT

  • Move to top right corner of Swagger UI
  • Click Authorize button & paste the JWT
  • Click Authorize
  • Now you will be able to access the protected API endpoints
Accessing.protected.APIs.compressed.mp4