# Authorization in Monitor

**URL:** <https://community.postman.com/t/authorization-in-monitor/5144>\
**Category:** Help Hub\
**Tags:** monitor\
**Created:** [April 25, 2019, 8:45am UTC](https://community.postman.com/t/authorization-in-monitor/5144 "2019-04-25T08:45:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VABDEB](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@VABDEB](https://community.postman.com/u/VABDEB)\
**Post date:** [April 25, 2019, 8:45am UTC](https://community.postman.com/t/authorization-in-monitor/5144/1 "2019-04-25T08:45:14Z")

</div>

Hello,

I created a test in postman, which runs successfully. I added the test to the monitor, but it fails. He calls the correct link, so I think that the problem is the authorization.

In the ‘manual test’ I used the basic authorization, but I got the feeling that once the test runs in the monitor, the authorization values are not used.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/6/3/63a54d3cd3eb7404564a8fd85310d9e62943483d.png)

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 25, 2019, 9:23am UTC](https://community.postman.com/t/authorization-in-monitor/5144/2 "2019-04-25T09:23:57Z")

</div>

Hey @VABDEB

Welcome to the community! 🙂

I’m not entirely sure based on your information why that’s happening but I could provide a couple of different ways that you could add Authentication, that you could try out.

The `basic` auth is just creating a base64 encoded value of your username and password so it doesn’t _need_ to use the `Auth` feature to achieve this for your request.

You could create this in a `Pre-request Script`, with the `Crypto-JS` library, then save the token value as an `environment` variable.

```
var CryptoJS = require("crypto-js")

var creds = CryptoJS.enc.Utf8.parse(`${pm.environment.get('user')}:password`);
var base64Token = CryptoJS.enc.Base64.stringify(creds);

pm.environment.set("token", base64Token);

```

This can be referenced in the request header like this:

 ![55](https://us1.discourse-cdn.com/getpostman/original/3X/1/7/17639b49efd5a5d6c819e2378728aca05f477154.png)

You could also use an external tool like [base64encode](https://www.base64encode.org/) to create the token value using your credentials.

The format required in the tool would be like this:

`username:password`

It will create a basic auth token like this:

`dXNlcm5hbWU6cGFzc3dvcmQ=`

You could then paste this hardcoded value into the request header - It should then authenticate your request.

 ![40](https://us1.discourse-cdn.com/getpostman/original/3X/3/1/31ab416b3d2e93d64ec3d3d27f1bd00a7bcd5ca1.png)

---

<div class="post-metadata">

**Author:** ![VABDEB](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@VABDEB](https://community.postman.com/u/VABDEB)\
**Post date:** [April 26, 2019, 10:21am UTC](https://community.postman.com/t/authorization-in-monitor/5144/3 "2019-04-26T10:21:10Z")

</div>

Thanks!! 🙂
