---
schema_version: "1"
id: be1ee0fdbb84d34e7cf62cc37277f04b27f379fa4711ea6de3fe6bc8a83050e1
title: getBasicAuthHeader | @tableau/taco-toolkit - v2.1.0
collection: tableau
version: next
locale: en-us
portal_url: https://docs.salesforce.com/tableau/next/en-us/api/webdataconnector/reference/functions/app.getBasicAuthHeader.md
canonical_url: https://help.tableau.com/v0.0/api/webdataconnector/en-us/reference/functions/app.getBasicAuthHeader.html
source_site: help.tableau.com
content_type: documentation
content_hash: 8fb225ce40707ea6ccf23064b97e42cafee9f991420d3b5ea8665c32b3a26ac2
description: Documentation for @tableau/taco-toolkit
---
- [@tableau/taco-toolkit](https://help.tableau.com/v0.0/api/webdataconnector/en-us/reference/index.html)
- [app](https://help.tableau.com/v0.0/api/webdataconnector/en-us/reference/modules/app.html)
- [getBasicAuthHeader](https://help.tableau.com/v0.0/api/webdataconnector/en-us/reference/functions/app.getBasicAuthHeader.html)

# Function getBasicAuthHeader

- getBasicAuthHeader(username, password): [AuthHeader](https://help.tableau.com/v0.0/api/webdataconnector/en-us/reference/types/app.AuthHeader.html)[](#getBasicAuthHeader)
- Generates a Basic authentication header using the provided username and password.
    
    #### Parameters
    
    - ##### username: string
        
        The username for authentication.
    - ##### password: string
        
        The password for authentication.
    
    #### Returns [AuthHeader](https://help.tableau.com/v0.0/api/webdataconnector/en-us/reference/types/app.AuthHeader.html)
    
    The Basic authentication header.
    
    #### Example
    
    ```
    // Generating a Basic authentication headerconst username = 'yourUsername';const password = 'yourPassword';const basicAuthHeader = getBasicAuthHeader(username, password);console.log(basicAuthHeader);// Output will be: { Authorization: 'Basic base64EncodedString' }
    ```

### Settings

#### Member Visibility

- Inherited

#### Theme

OSLightDark

Generated using [TypeDoc](https://typedoc.org/)