markcdev101 / spring-flavour-vault-backend

Repository for backend code for Flavour Vault
0 stars 0 forks source link

Ticket 31: POSTman Scripts #25

Closed markcdev101 closed 1 month ago

markcdev101 commented 1 month ago

Description: We have an API endpoint that generates a token. This token should be automatically reused in subsequent Postman requests for Bearer token authentication. The goal of this ticket is to configure Postman such that once the token is generated, it is stored and injected as a Bearer token in subsequent API requests.

Guide:

  1. Create an environment
  2. Make the request that generates a token
  3. In the script section write the following code that stores the generated script in the token variable
  4. const response = pm.response.json(); pm.environment.set("token", response.token);
  5. Use the token in the Authorization tab, select Bearer Token and add {{token}}

Acceptance Criteria:

markcdev101 commented 1 month ago

This is working in postman.