normalizeOpenIdIssuer (auth/openid.ts)

librechat · packages/api/src/auth/openid.ts · typescript · MIT
auth, tag:embed-classified

Normalizes OpenID issuers, extracts claims, and builds MongoDB query conditions for authentication.

// Source: https://github.com/danny-avila/librechat | License: MIT | Copyright 2026 LibreChat
// Provided via justclaw.it.com; keep this notice with the code.
import { logger } from '@librechat/data-schemas';
import { ErrorTypes } from 'librechat-data-provider';
import type { IUser, AppConfig, UserMethods, UserRecord } from '@librechat/data-schemas';
import type { FilterQuery } from 'mongoose';
import type {
  GetAppConfig,
  GetBalanceConfig,
  FindBalanceByUser,
  CreateUserIfAbsent,
} from './provision';
import type { OpenIDUserLookupResult } from '~/app/metrics';
import { isMetricsConfigured, recordOpenIDUserLookup } from '~/app/metrics';
import { createUserOnce } from './provision';

export type OpenIdEmailClaims = {
  email?: unknown;
  preferred_username?: unknown;
  upn?: unknown;


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

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

Get a free API key