import { AlertCircle, CloudOff } from "lucide-react"; import Card from "~/components/card"; import Code from "~/components/code"; import Link from "~/components/link"; import type { OidcErrorCode } from "~/server/oidc/provider"; export function OidcDiscoveryFailedNotice() { return (
SSO Temporarily Unavailable
Unable to reach the identity provider. Single Sign-On will be available once the provider is reachable again. You can still sign in with an API key.
); } export function OidcConfigErrorNotice({ errors }: { errors: OidcErrorCode[] }) { return (
Authentication Error
The OpenID Connect (OIDC) Single Sign-On (SSO) configuration has issues:{" "} {" "} Learn more
); } function mapOidcErrorsToMessages(errors: OidcErrorCode[]) { const messages: { key: string; node: React.ReactNode; }[] = []; for (const error of errors) { switch (error) { case "invalid_api_key": { messages.push({ key: error, node: ( The provided API key for OIDC authentication is invalid. Ensure that{" "} headscale.api_key is a valid API key. ), }); break; } case "missing_endpoints": { messages.push({ key: error, node: ( The OIDC provider is missing required endpoints. Ensure the discovery URL is correct or provide manual endpoint overrides in your configuration. ), }); break; } case "discovery_failed": { messages.push({ key: error, node: ( Unable to reach the OIDC provider for discovery. SSO will retry on the next login attempt. ), }); break; } default: { messages.push({ key: error, node: ( An unknown OIDC configuration error occurred. Please check the Headplane logs for more information. ), }); break; } } } return messages; }