# Authorization

## Authorization Types

* [No auth](#no-auth)&#x20;
* [Inherit from parent](#inherit-from-parent)&#x20;
* [Basic auth ](#basic-auth)
* [Bearer auth](#bearer-auth)&#x20;
* [Digest Auth](#digest-auth)&#x20;
* [OAuth 1.0](#oauth-1-0)

{% hint style="info" %}
You can use [environment variables](https://docs.testmace.com/master/variables/env) as the Username, Password, Token, and other authorization parameters.
{% endhint %}

## No auth&#x20;

Use the No Auth type if you don't need authorization while sending a request.

## Inherit from parent&#x20;

**By default** authorization parameters are inherited from the parent node. If the parameters are not specified, the [No auth](#no-auth) type is used.

## Basic auth

The type is used when login and password are required for sending a request.

#### Using Basic auth

Open the request and click on the Authorization tab and choose Digest auth. Set the Username and Password in the corresponding fields.

![Using Basic auth](https://1914040845-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYfhIaTTw23Sf3L5jfe%2F-LhFk_4qC8J17tr9_76X%2F-LhFkbR2YI_AGpENjeVK%2Fbasic%20auth.jpg?alt=media\&token=aa594234-64ea-4626-9e17-5bf1eb27667d)

## Bearer auth&#x20;

Bearer auth is a token based authorization. Any user with the bearer token can use it to get the access to the resources.

#### Using Bearer auth

Open the request and click on the Authorization tab and choose Bearer auth. Set the token in the token field.

![Using Bearer auth](https://1914040845-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYfhIaTTw23Sf3L5jfe%2F-LhFk_4qC8J17tr9_76X%2F-LhFktGKTScYA6iltlB5%2FBearer%20auth.jpg?alt=media\&token=2f9ca009-3372-4b05-99d5-9228092afe5a)

## Digest Auth&#x20;

Using this method, you send a hashed login, password, the server url and nonce values, which provides a higher security level than basic authorization, where you send data with no encryption.

#### Using Digest Auth

Open the request and click on the Authorization tab and choose Digest auth. Set the Username and Password in the corresponding fields.

![Using environment variables in Digest Auth](https://1914040845-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYfhIaTTw23Sf3L5jfe%2F-LhFk_4qC8J17tr9_76X%2F-LhFl7UguhAzny4ZIv--%2Fdigest.jpg?alt=media\&token=6ddba7ac-b6fd-43af-9d27-942f871da5d5)

## OAuth 1.0

OAuth 1.0 allows you to access protected resources without exposing your login and password.

#### Using OAuth 1.0

Open the request and click on the Authorization tab and choose OAuth 1.0. Input required data in the fields.

#### The OAuth 1.0 parameters supported in TestMace

| Parameters       | Description                                          |
| ---------------- | ---------------------------------------------------- |
| Consumer Key     | The key                                              |
| Consumer Secret  | The consumer code                                    |
| Access Token     | The token                                            |
| Token Secret     | The token code                                       |
| Signature Method | The signature Method: PLAINTEXT, HMAC-SHA1, RSA-SHA1 |
| Version          | 1.0                                                  |
| Realm            | The server the request is sent to                    |

![Using OAuth 1.0](https://1914040845-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYfhIaTTw23Sf3L5jfe%2F-LhFk_4qC8J17tr9_76X%2F-LhFlV94xsc8cmlGmUbe%2Foauth1.jpg?alt=media\&token=c02c4bb2-8547-426f-a0d5-b8791b4d89f2)
