{
return (
<>
-
-
-
-
- VEDA Auth Portal
-
+
+
+
+
+
+
+ VEDA Auth Portal
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
-
+
{children}
diff --git a/veda-auth-portal/src/index.tsx b/veda-auth-portal/src/index.tsx
index 4e4099e..8fb9e58 100644
--- a/veda-auth-portal/src/index.tsx
+++ b/veda-auth-portal/src/index.tsx
@@ -2,16 +2,11 @@ import { createRoot } from 'react-dom/client';
import App from './App';
import { extendTheme, ChakraProvider } from '@chakra-ui/react'
import { AuthProvider, AuthProviderProps } from "react-oidc-context";
-import oidcConfig from './lib/oidcConfig.json'
-import { BACKEND_URL } from './lib/constants';
+import localOidcConfig from './lib/localOidcConfig.json';
+import prodOidcConfig from './lib/prodOidcConfig.json';
+import { BACKEND_URL, CLIENT_ID } from './lib/constants';
import { WebStorageStateStore } from 'oidc-client-ts';
-// if (!oidcConfig) {
-// console.error('OIDC configuration not found');
-// } else {
-// console.log('OIDC configuration found', oidcConfig);
-// }
-
const theme = extendTheme({
colors: {
default: {
@@ -29,23 +24,37 @@ const theme = extendTheme({
},
});
-const theConfig:AuthProviderProps= {
+let theOidcConfig;
+let redirect_uri:string;
+
+if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
+ theOidcConfig = localOidcConfig;
+ redirect_uri = 'http://localhost:5173/oauth-callback';
+} else {
+ // production code
+ theOidcConfig = prodOidcConfig;
+ redirect_uri = 'https://veda.usecustos.org/oauth-callback';
+}
+
+const theConfig:AuthProviderProps = {
authority: `${BACKEND_URL}/api/v1/identity-management/`,
- client_id: "veda-dafsxhsztbsczrmmbftw-10000000",
- redirect_uri: "http://localhost:5173/oauth-callback",
+ client_id: CLIENT_ID,
+ redirect_uri: redirect_uri,
response_type: "code",
scope: "openid email",
metadata: {
- authorization_endpoint: oidcConfig.authorization_endpoint,
- token_endpoint: oidcConfig.token_endpoint,
- revocation_endpoint: oidcConfig.revocation_endpoint,
- introspection_endpoint: oidcConfig.introspection_endpoint,
- userinfo_endpoint: oidcConfig.userinfo_endpoint,
- jwks_uri: oidcConfig.jwks_uri,
+ authorization_endpoint: theOidcConfig.authorization_endpoint,
+ token_endpoint: theOidcConfig.token_endpoint,
+ revocation_endpoint: theOidcConfig.revocation_endpoint,
+ introspection_endpoint: theOidcConfig.introspection_endpoint,
+ userinfo_endpoint: theOidcConfig.userinfo_endpoint,
+ jwks_uri: theOidcConfig.jwks_uri,
},
userStore: new WebStorageStateStore({ store: window.localStorage }),
+ automaticSilentRenew: true,
};
+
const container = document.getElementById('root') as HTMLElement;
const root = createRoot(container);
root.render(
diff --git a/veda-auth-portal/src/interfaces/GroupMembership.tsx b/veda-auth-portal/src/interfaces/GroupMembership.tsx
deleted file mode 100644
index e328179..0000000
--- a/veda-auth-portal/src/interfaces/GroupMembership.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-export interface GroupMembership {
- id: string;
- name: string;
- created_time: string;
- last_modified_time: string;
- description: string;
- owner_id: string;
- num_members?: number;
- your_role?: string;
-};
diff --git a/veda-auth-portal/src/interfaces/Groups.tsx b/veda-auth-portal/src/interfaces/Groups.tsx
new file mode 100644
index 0000000..f482a03
--- /dev/null
+++ b/veda-auth-portal/src/interfaces/Groups.tsx
@@ -0,0 +1,39 @@
+export interface GroupMembership {
+ id: string;
+ name: string;
+ created_time: string;
+ last_modified_time: string;
+ description: string;
+ owner_id: string;
+ num_members?: number;
+ your_role?: string;
+};
+
+export interface Member {
+ username: string;
+ email: string;
+ first_name: string;
+ last_name: string;
+ created_at: string;
+ last_modified_at: string;
+ membership_type: string;
+}
+
+export interface Group {
+ id: string;
+ name: string;
+ realm_roles?: string[];
+ client_roles?: string[];
+ parent_id?: string;
+ created_time: string;
+ last_modified_time: string;
+ attributes?: Attribute[];
+ description: string;
+ owner_id: string;
+}
+
+export interface Attribute {
+ id: number;
+ key: string;
+ value: string[];
+}
\ No newline at end of file
diff --git a/veda-auth-portal/src/lib/constants.ts b/veda-auth-portal/src/lib/constants.ts
index 00b7832..a14ae6c 100644
--- a/veda-auth-portal/src/lib/constants.ts
+++ b/veda-auth-portal/src/lib/constants.ts
@@ -1,5 +1,13 @@
import packageJson from '../../package.json';
export const PORTAL_VERSION = packageJson.version;
-export const CLIENT_ID = '';
-export const BACKEND_URL = 'http://localhost:8081'
\ No newline at end of file
+export let CLIENT_ID:string;
+export let BACKEND_URL:string;
+
+if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
+ CLIENT_ID = 'veda-dafsxhsztbsczrmmbftw-10000000';
+ BACKEND_URL = 'http://localhost:8081';
+} else {
+ CLIENT_ID = 'veda-iui65nmkgaf7bihdyndc-10000000';
+ BACKEND_URL = 'https://api.veda.usecustos.org';
+}
\ No newline at end of file
diff --git a/veda-auth-portal/src/lib/oidcConfig.json b/veda-auth-portal/src/lib/localOidcConfig.json
similarity index 100%
rename from veda-auth-portal/src/lib/oidcConfig.json
rename to veda-auth-portal/src/lib/localOidcConfig.json
diff --git a/veda-auth-portal/src/lib/prodOidcConfig.json b/veda-auth-portal/src/lib/prodOidcConfig.json
new file mode 100644
index 0000000..6c9d4ee
--- /dev/null
+++ b/veda-auth-portal/src/lib/prodOidcConfig.json
@@ -0,0 +1,285 @@
+{
+ "issuer": "https://10000000.veda-auth-central.org",
+ "authorization_endpoint": "https://api.veda.usecustos.org/api/v1/identity-management/authorize",
+ "token_endpoint": "https://api.veda.usecustos.org/api/v1/identity-management/token",
+ "userinfo_endpoint": "https://api.veda.usecustos.org/api/v1/user-management/userinfo",
+ "jwks_uri": "https://api.veda.usecustos.org/api/v1/identity-management/.well-known/jwks.json",
+ "response_types_supported": [
+ "code",
+ "none",
+ "id_token",
+ "token",
+ "id_token token",
+ "code id_token",
+ "code token",
+ "code id_token token"
+ ],
+ "subject_types_supported": [
+ "public",
+ "pairwise"
+ ],
+ "id_token_signing_alg_values_supported": [
+ "PS384",
+ "ES384",
+ "RS384",
+ "HS256",
+ "HS512",
+ "ES256",
+ "RS256",
+ "HS384",
+ "ES512",
+ "PS256",
+ "PS512",
+ "RS512"
+ ],
+ "scopes_supported": [
+ "openid",
+ "email",
+ "address",
+ "roles",
+ "example:doc:delete",
+ "profile",
+ "offline_access",
+ "microprofile-jwt",
+ "phone",
+ "user:email",
+ "example:doc:create",
+ "web-origins",
+ "example:doc:read",
+ "acr",
+ "example:doc:update"
+ ],
+ "token_endpoint_auth_methods_supported": [
+ "private_key_jwt",
+ "client_secret_basic",
+ "client_secret_post",
+ "tls_client_auth",
+ "client_secret_jwt"
+ ],
+ "claims_supported": [
+ "aud",
+ "sub",
+ "iss",
+ "auth_time",
+ "name",
+ "given_name",
+ "family_name",
+ "preferred_username",
+ "email",
+ "acr"
+ ],
+ "introspection_endpoint_auth_signing_alg_values_supported": [
+ "PS384",
+ "ES384",
+ "RS384",
+ "HS256",
+ "HS512",
+ "ES256",
+ "RS256",
+ "HS384",
+ "ES512",
+ "PS256",
+ "PS512",
+ "RS512"
+ ],
+ "request_parameter_supported": true,
+ "pushed_authorization_request_endpoint": "https://auth.veda.usecustos.org/auth/realms/10000000/protocol/openid-connect/ext/par/request",
+ "introspection_endpoint": "https://api.veda.usecustos.org/api/v1/identity-management/token/introspect",
+ "claims_parameter_supported": true,
+ "id_token_encryption_enc_values_supported": [
+ "A256GCM",
+ "A192GCM",
+ "A128GCM",
+ "A128CBC-HS256",
+ "A192CBC-HS384",
+ "A256CBC-HS512"
+ ],
+ "userinfo_encryption_enc_values_supported": [
+ "A256GCM",
+ "A192GCM",
+ "A128GCM",
+ "A128CBC-HS256",
+ "A192CBC-HS384",
+ "A256CBC-HS512"
+ ],
+ "introspection_endpoint_auth_methods_supported": [
+ "private_key_jwt",
+ "client_secret_basic",
+ "client_secret_post",
+ "tls_client_auth",
+ "client_secret_jwt"
+ ],
+ "authorization_encryption_alg_values_supported": [
+ "RSA-OAEP",
+ "RSA-OAEP-256",
+ "RSA1_5"
+ ],
+ "tls_client_certificate_bound_access_tokens": true,
+ "response_modes_supported": [
+ "query",
+ "fragment",
+ "form_post",
+ "query.jwt",
+ "fragment.jwt",
+ "form_post.jwt",
+ "jwt"
+ ],
+ "backchannel_logout_session_supported": true,
+ "backchannel_authentication_request_signing_alg_values_supported": [
+ "PS384",
+ "ES384",
+ "RS384",
+ "ES256",
+ "RS256",
+ "ES512",
+ "PS256",
+ "PS512",
+ "RS512"
+ ],
+ "authorization_encryption_enc_values_supported": [
+ "A256GCM",
+ "A192GCM",
+ "A128GCM",
+ "A128CBC-HS256",
+ "A192CBC-HS384",
+ "A256CBC-HS512"
+ ],
+ "revocation_endpoint_auth_signing_alg_values_supported": [
+ "PS384",
+ "ES384",
+ "RS384",
+ "HS256",
+ "HS512",
+ "ES256",
+ "RS256",
+ "HS384",
+ "ES512",
+ "PS256",
+ "PS512",
+ "RS512"
+ ],
+ "backchannel_token_delivery_modes_supported": [
+ "poll",
+ "ping"
+ ],
+ "revocation_endpoint_auth_methods_supported": [
+ "private_key_jwt",
+ "client_secret_basic",
+ "client_secret_post",
+ "tls_client_auth",
+ "client_secret_jwt"
+ ],
+ "request_uri_parameter_supported": true,
+ "grant_types_supported": [
+ "authorization_code",
+ "implicit",
+ "refresh_token",
+ "password",
+ "client_credentials",
+ "urn:ietf:params:oauth:grant-type:device_code",
+ "urn:openid:params:grant-type:ciba",
+ "urn:ietf:params:oauth:grant-type:token-exchange"
+ ],
+ "require_request_uri_registration": true,
+ "code_challenge_methods_supported": [
+ "plain",
+ "S256"
+ ],
+ "id_token_encryption_alg_values_supported": [
+ "RSA-OAEP",
+ "RSA-OAEP-256",
+ "RSA1_5"
+ ],
+ "frontchannel_logout_session_supported": true,
+ "authorization_signing_alg_values_supported": [
+ "PS384",
+ "ES384",
+ "RS384",
+ "HS256",
+ "HS512",
+ "ES256",
+ "RS256",
+ "HS384",
+ "ES512",
+ "PS256",
+ "PS512",
+ "RS512"
+ ],
+ "request_object_signing_alg_values_supported": [
+ "PS384",
+ "ES384",
+ "RS384",
+ "HS256",
+ "HS512",
+ "ES256",
+ "RS256",
+ "HS384",
+ "ES512",
+ "PS256",
+ "PS512",
+ "RS512",
+ "none"
+ ],
+ "request_object_encryption_alg_values_supported": [
+ "RSA-OAEP",
+ "RSA-OAEP-256",
+ "RSA1_5"
+ ],
+ "check_session_iframe": "https://auth.veda.usecustos.org/auth/realms/10000000/protocol/openid-connect/login-status-iframe.html",
+ "backchannel_logout_supported": true,
+ "acr_values_supported": [
+ "0",
+ "1"
+ ],
+ "request_object_encryption_enc_values_supported": [
+ "A256GCM",
+ "A192GCM",
+ "A128GCM",
+ "A128CBC-HS256",
+ "A192CBC-HS384",
+ "A256CBC-HS512"
+ ],
+ "device_authorization_endpoint": "https://auth.veda.usecustos.org/auth/realms/10000000/protocol/openid-connect/auth/device",
+ "userinfo_signing_alg_values_supported": [
+ "PS384",
+ "ES384",
+ "RS384",
+ "HS256",
+ "HS512",
+ "ES256",
+ "RS256",
+ "HS384",
+ "ES512",
+ "PS256",
+ "PS512",
+ "RS512",
+ "none"
+ ],
+ "claim_types_supported": [
+ "normal"
+ ],
+ "userinfo_encryption_alg_values_supported": [
+ "RSA-OAEP",
+ "RSA-OAEP-256",
+ "RSA1_5"
+ ],
+ "end_session_endpoint": "https://auth.veda.usecustos.org/auth/realms/10000000/protocol/openid-connect/logout",
+ "revocation_endpoint": "https://auth.veda.usecustos.org/auth/realms/10000000/protocol/openid-connect/revoke",
+ "backchannel_authentication_endpoint": "https://auth.veda.usecustos.org/auth/realms/10000000/protocol/openid-connect/ext/ciba/auth",
+ "frontchannel_logout_supported": true,
+ "token_endpoint_auth_signing_alg_values_supported": [
+ "PS384",
+ "ES384",
+ "RS384",
+ "HS256",
+ "HS512",
+ "ES256",
+ "RS256",
+ "HS384",
+ "ES512",
+ "PS256",
+ "PS512",
+ "RS512"
+ ],
+ "registration_endpoint": "https://auth.veda.usecustos.org/auth/realms/10000000/clients-registrations/openid-connect"
+}
\ No newline at end of file
|