Postman pre-request script to fetch a token from Keycloak and set it to a collection variable to use in request headers.
This is a javascript-Script for use with Postman's pre-request script feature. It makes POST request to Keycloak Token Endpoint to get a valid token and automatically set the token for all requests in Postman collection. This will enable to make request as if a logged in user would make them to an API.
This client will only be used for Postman then. Btw. don´t forget to hit "save".