forked from baron/baron-sso
feat: integrate orgfront and expose internal ids
This commit is contained in:
23
deploy/templates/orgfront/auth.ts
Normal file
23
deploy/templates/orgfront/auth.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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 ||
|
||||
`${window.location.protocol}//${window.location.hostname}:{{USERFRONT_PORT}}/oidc`,
|
||||
client_id: import.meta.env.VITE_OIDC_CLIENT_ID || "orgfront",
|
||||
redirect_uri: `${window.location.origin}/auth/callback`,
|
||||
response_type: "code",
|
||||
scope: "openid offline_access profile email",
|
||||
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 || "",
|
||||
});
|
||||
Reference in New Issue
Block a user