Skip to content

Commit e2164bd

Browse files
fix: set oidc_load_user as env
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
1 parent 83fbcee commit e2164bd

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

client/src/app/oidc.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const OIDC_SERVER_URL = isAuthServerEmbedded
77
? ENV.OIDC_SERVER_EMBEDDED_PATH || "/auth/realms/trustify"
88
: ENV.OIDC_SERVER_URL || "http://localhost:8090/realms/trustify";
99
export const OIDC_CLIENT_ID = ENV.OIDC_CLIENT_ID || "frontend";
10+
export const OIDC_LOAD_USER = ENV.OIDC_LOAD_USER === "true";
1011

1112
// Cognito requires client_id + logout_uri.
1213
// Keycloak ignores both (uses id_token_hint + post_logout_redirect_uri added by oidc-client-ts instead) and follows the OIDC RP-Initiated Logout spec.
@@ -23,6 +24,6 @@ export const oidcClientSettings: OidcClientSettings = {
2324
redirect_uri: window.location.origin,
2425
post_logout_redirect_uri: window.location.origin,
2526
response_type: "code",
26-
loadUserInfo: false,
27+
loadUserInfo: OIDC_LOAD_USER,
2728
scope: ENV.OIDC_SCOPE || "openid",
2829
};

common/src/environment.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export type TrustificationEnvType = {
4040
/** The Keycloak Realm */
4141
OIDC_SERVER_EMBEDDED_PATH?: string;
4242

43+
/** Whether or not call to /loaduser endpoint on Auth flow */
44+
OIDC_LOAD_USER?: "true" | "false";
45+
4346
/** Target URL for the UI server's `/api` proxy */
4447
TRUSTIFY_API_URL?: string;
4548

@@ -68,6 +71,7 @@ export const buildTrustificationEnv = ({
6871
AUTH_REQUIRED = "true",
6972
OIDC_CLIENT_ID,
7073
OIDC_SCOPE,
74+
OIDC_LOAD_USER = "true",
7175

7276
UI_INGRESS_PROXY_BODY_SIZE = "500m",
7377
TRUSTIFY_API_URL,
@@ -81,6 +85,7 @@ export const buildTrustificationEnv = ({
8185
OIDC_SERVER_URL,
8286
OIDC_SERVER_IS_EMBEDDED,
8387
OIDC_SERVER_EMBEDDED_PATH,
88+
OIDC_LOAD_USER,
8489
AUTH_REQUIRED,
8590
OIDC_CLIENT_ID,
8691
OIDC_SCOPE,

crate/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ pub struct UI {
2828

2929
#[serde(rename(serialize = "OIDC_SCOPE"))]
3030
pub oidc_scope: String,
31+
32+
#[serde(rename(serialize = "OIDC_LOAD_USER"))]
33+
pub oidc_load_user: String,
3134
}
3235

3336
pub fn trustify_ui_resources() -> HashMap<&'static str, Resource> {

0 commit comments

Comments
 (0)