@eternal-baguette/auth
v2.1.5
Published
Functions to help authenticate with the Coveo platform.
Readme
@coveo/auth
Functions to help authenticate with the Coveo platform.
Install
npm i @coveo/authSAML
Configure a SAML authentication provider on your organization.
Inside your web application, instantiate the SAML client in this package.
Example
import {buildSamlClient} from '@eternal-baguette/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 '@eternal-baguette/auth`;
import {buildSearchEngine} from '@eternal-baguette/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
- Code example available here.
Reference
SamlClientOptions
organizationId: stringThe unique identifier of the target Coveo Cloud organization (e.g.,
mycoveoorganization8tp8wu3).provider: stringThe SAML authentication provider name (e.g.,
oktaA323aab78b9f1-45b5-a095-a1f0fa09ddd5).platformOrigin?: stringThe Coveo origin to authenticate through.
Default value is
https://platform.cloud.coveo.com.
