resolveOneLoginIssuer (multi-tenant-sso/oidcDiscovery.ts)

langfuse · web/src/ee/features/multi-tenant-sso/oidcDiscovery.ts · typescript · MIT
auth, tag:embed-classified

eslint-disable @typescript-eslint/no-use-before-define */

// Source: https://github.com/langfuse/langfuse | License: MIT | Copyright 2023-2026 ClickHouse, Inc
// Provided via justclaw.it.com; keep this notice with the code.
/* eslint-disable @typescript-eslint/no-use-before-define */
const oneLoginOidcPath = "/oidc/2";

/**
 * resolveOneLoginIssuer returns the OIDC issuer for a configured OneLogin URL.
 * A URL ending in `/oidc/2` (`https://acme.onelogin.com/oidc/2`) is already the
 * issuer; anything else (`https://acme.onelogin.com`) gets `/oidc/2` appended,
 * matching NextAuth's OneLogin provider. The trailing slash is removed.
 */
export function resolveOneLoginIssuer(configured: string): string {
  const base = stripTrailingSlash(configured);
  return base.endsWith(oneLoginOidcPath) ? base : `${base}${oneLoginOidcPath}`;
}

/** getDiscovery

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key