Interface AuthAPI

The AuthAPI interface provides the public interface for the auth module.

interface AuthAPI {
    getAccessToken: (
        __namedParameters: { hostConfig?: HostConfig },
    ) => Promise<string>;
    getWebResourceAuthParams: (
        __namedParameters: { hostConfig?: HostConfig },
    ) => Promise<WebResourceAuthParams>;
    registerAuthModule: <A extends keyof QlikAuthModules>(
        name: A,
        authModule: AuthModule<A>,
    ) => void;
    registerHostConfig: (name: string, hostConfig: HostConfig) => void;
    setDefaultHostConfig: (hostConfig: undefined | HostConfig) => void;
    unregisterHostConfig: (name: string) => void;
}
Index

Properties

getAccessToken: (
    __namedParameters: { hostConfig?: HostConfig },
) => Promise<string>

Returns an access token using the supplied host config. Typically used on the backend to supply the access token to the frontend

Type declaration

    • (__namedParameters: { hostConfig?: HostConfig }): Promise<string>
    • Returns an access token using the supplied host config. Typically used on the backend to supply the access token to the frontend

      Parameters

      Returns Promise<string>

getWebResourceAuthParams: (
    __namedParameters: { hostConfig?: HostConfig },
) => Promise<WebResourceAuthParams>

Returns a record of query parameters that needs to be added to resources requests, e.g. image tags, etc.

Type declaration

registerAuthModule: <A extends keyof QlikAuthModules>(
    name: A,
    authModule: AuthModule<A>,
) => void

Registers an auth module that can handle authentication. An auth module is used by specifying its name as authType in the HostConfig passed in to api calls.

Type declaration

    • <A extends keyof QlikAuthModules>(name: A, authModule: AuthModule<A>): void
    • Registers an auth module that can handle authentication. An auth module is used by specifying its name as authType in the HostConfig passed in to api calls.

      Type Parameters

      • A extends keyof QlikAuthModules

      Parameters

      • name: A

        the name of the module

      • authModule: AuthModule<A>

        the implementation of the AuthModule interface

      Returns void

the name of the module

the implementation of the AuthModule interface

registerHostConfig: (name: string, hostConfig: HostConfig) => void

Registers a host config with the given name.

Type declaration

    • (name: string, hostConfig: HostConfig): void
    • Registers a host config with the given name.

      Parameters

      • name: string

        The name of the host config to be used to reference the host config later.

      • hostConfig: HostConfig

        The host config to register.

      Returns void

The name of the host config to be used to reference the host config later.

The host config to register.

setDefaultHostConfig: (hostConfig: undefined | HostConfig) => void

Sets the default host config that will be used for all qmfe api calls that do not include a host config

Type declaration

    • (hostConfig: undefined | HostConfig): void
    • Sets the default host config that will be used for all qmfe api calls that do not inclue a HostConfig

      Parameters

      • hostConfig: undefined | HostConfig

        the default HostConfig to use

      Returns void

the default HostConfig to use

unregisterHostConfig: (name: string) => void

Unregisters a host config with the given name.

Type declaration

    • (name: string): void
    • Unregisters a host config with the given name.

      Parameters

      • name: string

        The name of the host config to unregister.

      Returns void

The name of the host config to unregister.