forked from baron/baron-sso
Details: - Backend: Extract Kratos session cookies and propagate via SetCookies in AuthInfo. - Backend: Include sessionJwt and token during OIDC flows in PasswordLogin. - UserFront: Add _silentSessionRecovery in main.dart to recover session via cookies if localStorage token is missing. - UserFront: Update AuthProxyService, AuthTokenStore, AuthNotifier to support silent recovery and immediate local state update before redirect. - AdminFront/DevFront: Fix OIDC authority to point directly to Gateway proxy and add recovery/error UI components.
23 lines
932 B
TypeScript
23 lines
932 B
TypeScript
import { UserManager, WebStorageStateStore } from "oidc-client-ts";
|
|
import type { AuthProviderProps } from "react-oidc-context";
|
|
|
|
export const oidcConfig: AuthProviderProps = {
|
|
authority:
|
|
import.meta.env.VITE_OIDC_AUTHORITY || "https://sso.hmac.kr/oidc", // Gateway Proxy URL
|
|
client_id: import.meta.env.VITE_OIDC_CLIENT_ID || "devfront",
|
|
redirect_uri: `${window.location.origin}/auth/callback`,
|
|
response_type: "code",
|
|
scope: "openid offline_access profile email", // offline_access for refresh token
|
|
post_logout_redirect_uri: window.location.origin,
|
|
popup_redirect_uri: `${window.location.origin}/auth/callback`,
|
|
userStore: new WebStorageStateStore({ store: window.localStorage }),
|
|
automaticSilentRenew: false,
|
|
};
|
|
|
|
export const userManager = new UserManager({
|
|
...oidcConfig,
|
|
authority: oidcConfig.authority || "",
|
|
client_id: oidcConfig.client_id || "",
|
|
redirect_uri: oidcConfig.redirect_uri || "",
|
|
});
|