My current project is Oauth 2.0 autho based.At postman,I can generate accesstoken using #Getnewaccesstoken button for my collection.
I dont want to click the generate token button in every time...Is any option there in prerequiste script form for automating this step...
Yes, you can use an
access token
to assignvariable
.Your current using token
This is demo, current you use "Get New Access Token" I am using Keycloak v.18, getting token as admin
New method using variable
You can make own POST call for getting
access-token
and then assign same name variable. Before your API call, you needs this code inTests
section.POST call, your token URL and key/value for your inputs.
If you success, will get response in body
How to use it in other API call.
In the
Authorization
tab, selectBearer Token
TypeAnd Add this code. it is access token.
Then you can call any API like this. Will get the result