Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support of global bearer token variable. #529

Merged
merged 2 commits into from
Oct 15, 2022

Conversation

buglinjo
Copy link
Contributor

@buglinjo buglinjo commented Oct 7, 2022

This update brings global bearer token setter in the postman file. If you set use_value as {{token}} in the scribe config file it'll automatically populate it when postman file is generated.

In you postman variables you can set that token automatically when sending login request using Postman's Tests. You can set this JS code in Tests tab and JWT token will be automatically populated and used globally by the API.

var jsonData = JSON.parse(responseBody);
pm.environment.set("token", jsonData.login.access_token);

This update brings global bearer token setting in the postman file.
If you set `use_value` as `{{token}}` in the scribe config file it'll automatically populate it when postman file is generated.

In you postman variables you can set that token automatically when sending login request using Postman's `Tests`. You can set this JS code in Tests tab and JWT token will be automatically populated and used globally by the API.
```javascript
var jsonData = JSON.parse(responseBody);
pm.environment.set("token", jsonData.login.access_token);
```
@shalvah
Copy link
Contributor

shalvah commented Oct 7, 2022

Update the test fixtures^^^

@buglinjo
Copy link
Contributor Author

buglinjo commented Oct 7, 2022

Updated Fixtures/collection.json and postman file generation test to support bearer global value

@shalvah shalvah merged commit 6bc3487 into knuckleswtf:master Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants