diff --git a/apps/api-gateway/src/lib/fedcm-config.ts b/apps/api-gateway/src/lib/fedcm-config.ts index 29cd8f5..225fb16 100644 --- a/apps/api-gateway/src/lib/fedcm-config.ts +++ b/apps/api-gateway/src/lib/fedcm-config.ts @@ -38,7 +38,9 @@ function buildFedcmEndpointUrls(issuer: string, frontendUrl: string) { accountsEndpoint: `${base}/fedcm/accounts`, clientMetadataEndpoint: `${base}/fedcm/client_metadata`, idAssertionEndpoint: `${base}/fedcm/id_assertion`, - loginUrl: `${front}/auth/login`, + // FedCM: login_url MUST be same-origin with config.json (W3C FedCM / Chrome). + // На split-domain UI проксируется через nginx: api.idpmvk.lpr/auth/login → frontend. + loginUrl: `${base}/auth/login`, signupUrl: `${front}/auth/register`, webIdentityUrl: `${webIdentityOrigin}/.well-known/web-identity` }; @@ -102,15 +104,16 @@ export async function resolveFedcmEndpoints(core: CoreGrpcService, _req?: Reques } export function buildFedcmProviderConfig(endpoints: FedcmEndpoints) { + const base = normalizePublicBaseUrl(endpoints.issuer); return { - accounts_endpoint: endpoints.accountsEndpoint, - client_metadata_endpoint: endpoints.clientMetadataEndpoint, - id_assertion_endpoint: endpoints.idAssertionEndpoint, + accounts_endpoint: `${base}/fedcm/accounts`, + client_metadata_endpoint: `${base}/fedcm/client_metadata`, + id_assertion_endpoint: `${base}/fedcm/id_assertion`, login_url: endpoints.loginUrl, branding: { background_color: '#ffffff', color: '#1f2430', - icons: [{ url: `${endpoints.frontendUrl}/favicon.ico`, size: 32 }] + icons: [{ url: `${base}/favicon.ico`, size: 32 }] } }; } diff --git a/apps/frontend/components/id/oauth-client-one-tap-section.tsx b/apps/frontend/components/id/oauth-client-one-tap-section.tsx index c4659bd..4c93861 100644 --- a/apps/frontend/components/id/oauth-client-one-tap-section.tsx +++ b/apps/frontend/components/id/oauth-client-one-tap-section.tsx @@ -96,6 +96,14 @@ export function OAuthClientOneTapSection({
login_url в config.json должен быть на том же домене, что и config (
+ {endpoints.issuer}/auth/login), не на SSO-домене.
+ configURL для FedCM: {endpoints.fedcmConfigUrl} (не{' '}
+ {frontendBase}/idp-api/fedcm/config.json).
+ PUBLIC_API_URL = {endpoints.issuer}.