# Username and password authentication

Source: https://developer.avalara.com/products/ecm/integration-guides/document-management/coa0890124811242/

Guide: Exemption Certificate Management (ECM)

# Username and password authentication

Learn how to use username and password authentication with AvaTax, including constructing an authentication token.

The simplest type of authentication uses a username and a password. If you use an AvaTax SDK, this encoding is done for you transparently. Just provide your credentials and the SDK will do all the work! For example, here’s how the AvaTax SDK for C# implements username/password authentication:

```
// Create a client and set up authentication
var Client = new AvaTaxClient("MyTestApp", "1.0", Environment.MachineName, AvaTaxEnvironment.Sandbox)
    .WithSecurity("MyUsername", "MyPassword");
```

Learn how to construct an authentication token for AvaTax using your username and password:

TASK

RESULT

Start with the word `Basic` followed by a username, a colon, and a password. There are no spaces between any values.

`Basic username:password`

Replace the `username` with your username, and the `password` with your password. Ensure that there are no whitespace characters unless those characters are part of your username or password.

`Basic bob@example.org:bobspasswordgoeshere`

Now, use your favorite [Base64 encoding program](https://www.google.com/webhp#q=base64+encoding) to encode the right-hand side of the string.

`Basic Ym9iQGV4YW1wbGUub3JnOmJvYnNwYXNzd29yZGdvZXNoZXJI`

Add this to the `Authorization` header in your HTTP request.

`Authorization: Basic Ym9iQGV4YW1wbGUub3JnOmJvYnNwYXNzd29yZGdvZXNoZXJI`

**Parent topic:** [Authentication methods overview](/document-management/wvt8458608805161/ "Learn about the authentication methods supported by AvaTax for API connections.")