Skip to content

Interface: MultiHeaderTokenAuthentication

Defined in: types.ts:400

Authenticate using multiple HTTP headers that you specify. Each header is specified with a name and an optional token prefix.

Example

pack.setUserAuthentication({
  type: coda.AuthenticationType.MultiHeaderToken,
  headers: [
    {name: 'Header1', description: 'Enter the value for Header1',  tokenPrefix: 'prefix1'},
    {name: 'Header2', description: 'Enter value for Header2'},
  ],
});

Extends

Properties

endpointDomain?

optional endpointDomain: string

Defined in: types.ts:283

When requiresEndpointUrl is set to true this should be the root domain that all endpoints share. For example, this value would be "example.com" if specific endpoints looked like {custom-subdomain}.example.com.

For packs that make requests to multiple domains (uncommon), this should be the domain within PackVersionDefinition.networkDomains that this configuration applies to.

Inherited from

BaseAuthentication.endpointDomain


getConnectionName?

optional getConnectionName: MetadataFormula

Defined in: types.ts:251

A function that is called when a user sets up a new account, that returns a name for the account to label that account in the UI. The users credentials are applied to any fetcher requests that this function makes. Typically, this function makes an API call to an API's "who am I" endpoint and returns a username.

If omitted, or if the function returns an empty value, the account will be labeled with the creating user's Coda username.

Inherited from

BaseAuthentication.getConnectionName


headers

headers: object[]

Defined in: types.ts:406

Names and descriptions of the headers used for authentication.

description

description: string

A description shown to the user indicating what value they should provide for this header.

name

name: string

The name of the HTTP header.

tokenPrefix?

optional tokenPrefix: string

An optional prefix in the HTTP header value before the actual token. Omit this if the token is the entirety of the header value.

The HTTP header will be of the form <headerName>: <tokenPrefix> <token>


instructionsUrl?

optional instructionsUrl: string

Defined in: types.ts:266

A link to a help article or other page with more instructions about how to set up an account for this pack.

Inherited from

BaseAuthentication.instructionsUrl


networkDomain?

optional networkDomain: string | string[]

Defined in: types.ts:297

Which domain(s) should get auth credentials, when a pack is configured with multiple domains. Packs configured with only one domain or with requiresEndpointUrl set to true can omit this.

Using multiple authenticated network domains is uncommon and requires Coda approval.

Inherited from

BaseAuthentication.networkDomain


postSetup?

optional postSetup: SetEndpoint[]

Defined in: types.ts:289

One or more setup steps to run after the user has set up the account, before completing installation of the pack. This is not common.

Inherited from

BaseAuthentication.postSetup


requiresEndpointUrl?

optional requiresEndpointUrl: boolean

Defined in: types.ts:274

If true, indicates this has pack has a specific endpoint domain for each account, that is used as the basis of HTTP requests. For example, API requests are made to .example.com rather than example.com. If true, the user will be prompted to provide their specific endpoint domain when creating a new account.

Inherited from

BaseAuthentication.requiresEndpointUrl


type

type: MultiHeaderToken

Defined in: types.ts:402

Identifies this as MultiHeaderToken authentication.