@coveo/auth
TypeScript icon, indicating that this package has built-in type declarations

1.11.18 • Public • Published

npm version

@coveo/auth

Functions to help authenticate with the Coveo platform.

Install

npm i @coveo/auth

SAML

  1. Configure a SAML authentication provider on your organization.

  2. Inside your web application, instantiate the SAML client in this package.

Example

import {buildSamlClient} from '@coveo/auth`;

const organizationId = '<organization id>';
const provider = '<configured SAML auth provider name>';

async function main() {
  const saml = buildSamlClient({organizationId, provider});
  const accessToken = await saml.authenticate();
  console.log(accessToken);
}

main();

Example with @coveo/headless

import {buildSamlClient} from '@coveo/auth`;
import {buildSearchEngine} from '@coveo/headless`;

async function main() {
  const saml = buildSamlClient(...);
  const accessToken = await saml.authenticate();

  const engine = buildSearchEngine({
    configuration: {
      organizationId,
      accessToken,
      renewAccessToken: saml.authenticate,
    },
  });
}

main()

Example with @coveo/headless and React

Reference

SamlClientOptions

  • organizationId: string

    The unique identifier of the target Coveo Cloud organization (e.g., mycoveoorganization8tp8wu3).

  • provider: string

    The SAML authentication provider name (e.g., oktaA323aab78b9f1-45b5-a095-a1f0fa09ddd5).

  • platformOrigin?: string

    The Coveo origin to authenticate through.

    Default value is https://platform.cloud.coveo.com.

Package Sidebar

Install

npm i @coveo/auth

Weekly Downloads

617

Version

1.11.18

License

Apache-2.0

Unpacked Size

26.9 kB

Total Files

13

Last publish

Collaborators

  • sallain
  • aboissinot
  • mmitiche
  • jkatofsky
  • agong-coveo
  • pixhel
  • ndlr
  • npmcoveo
  • camarois
  • lcoolen
  • coveo-organization
  • coveoit
  • olamothe
  • sssayegh
  • ylakhdar