From 5b9dcaf5608555d104a41de2852f4686728ceaf5 Mon Sep 17 00:00:00 2001
From: yassineouabou
Date: Fri, 22 May 2026 21:29:52 +0100
Subject: [PATCH] feat(ords-remix-jwt-sample): add OCI IAM and OCS
Signed-off-by: yassineouabou
---
templates/ords-remix-jwt-sample/.env.example | 50 +-
templates/ords-remix-jwt-sample/.gitignore | 20 +
.../app/components/admin/EventForm.tsx | 7 +-
.../app/components/admin/VenuesForm.tsx | 3 +-
.../app/components/artists/ArtistHome.tsx | 4 +-
.../app/components/artists/HeroBanner.tsx | 6 +-
.../app/components/concerts/ConcertBanner.tsx | 2 +-
.../app/components/error/ErrorPage.tsx | 2 +-
.../app/components/navbar/NavBar.tsx | 2 +-
.../app/models/ConcertProps.ts | 4 +-
.../app/models/NavBarProps.ts | 4 +-
.../app/models/OIDCProfile.ts | 21 +
.../app/routes/auth0.tsx | 2 +-
.../app/routes/callback.tsx | 2 +-
.../app/routes/constants/index.server.ts | 29 +-
.../app/routes/logout.tsx | 19 +-
.../ords-remix-jwt-sample/app/routes/oidc.tsx | 14 +
.../app/routes/sign-in.tsx | 6 +-
.../app/utils/auth.server.ts | 93 +-
.../ords-remix-jwt-sample/ords/README.MD | 209 +-
.../ords/RESTfulServices/RESTSchema.js | 128 +-
templates/ords-remix-jwt-sample/ords/drop.js | 54 +-
.../ords-remix-jwt-sample/ords/migrate.js | 99 +-
.../ords/migrateScripts/schemaObjects.js | 486 ++---
.../ords/security/README.MD | 255 +--
templates/ords-remix-jwt-sample/ords/seed.js | 56 +-
.../ords/seedScripts/batchload.js | 392 +++-
.../ords/utils/dropUser.js | 108 +-
.../ords/utils/enviroment.js | 12 +-
.../ords/utils/oracleConnection.js | 67 +
.../ords/utils/sqlExecutionLogger.js | 120 ++
.../ords_config_service/apispec.json | 1795 +++++++++++++++++
.../generate_from_plsql.mjs | 488 +++++
.../ords_config_service/oci_requests.sh | 37 +
templates/ords-remix-jwt-sample/package.json | 6 +-
35 files changed, 3673 insertions(+), 929 deletions(-)
create mode 100644 templates/ords-remix-jwt-sample/.gitignore
create mode 100644 templates/ords-remix-jwt-sample/app/models/OIDCProfile.ts
create mode 100644 templates/ords-remix-jwt-sample/app/routes/oidc.tsx
create mode 100644 templates/ords-remix-jwt-sample/ords/utils/oracleConnection.js
create mode 100644 templates/ords-remix-jwt-sample/ords/utils/sqlExecutionLogger.js
create mode 100644 templates/ords-remix-jwt-sample/ords_config_service/apispec.json
create mode 100644 templates/ords-remix-jwt-sample/ords_config_service/generate_from_plsql.mjs
create mode 100755 templates/ords-remix-jwt-sample/ords_config_service/oci_requests.sh
diff --git a/templates/ords-remix-jwt-sample/.env.example b/templates/ords-remix-jwt-sample/.env.example
index 3c55016..7c6b694 100644
--- a/templates/ords-remix-jwt-sample/.env.example
+++ b/templates/ords-remix-jwt-sample/.env.example
@@ -2,27 +2,41 @@
# All rights reserved
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
-# We refer to some variables as Autonomous Database specific
-# but you can use whichever ORDS URL you want/have as well as the user,
-# as long as this user is capable of creating and REST Enabling other schemas.
-ADB_ORDS_URL=https://example.com:8080/ords/
-ADB_ADMIN_USER=username
-ADB_ADMIN_PASSWORD=
+# ORDS base URL for your Base Database or ORDS instance.
+# Replace , , and with your actual values.
+# Keep the trailing slash.
+BD_ORDS_URL=http://:/ords/
+
+# Oracle Database connect string used by migrate/seed/drop scripts.
+# Examples:
+# host:1521/service_name
+# myadb_high (from tnsnames.ora when TNS_ADMIN is configured)
+BD_CONNECT_STRING=:/
+
+# Oracle Instant Client directory for Thick mode in node-oracledb.
+ORACLE_CLIENT_LIB_DIR=/instantclient_23_26
+
+# OCI IAM JWT credentials, used by ORDS to validate request to protected endpoints.
+JWT_ISSUER=https://identity.oraclecloud.com/
+JWT_VERIFICATION_KEY=https://:443/admin/v1/SigningCert/jwk
+JWT_AUDIENCE=ords/sample-app/
+
+BD_ADMIN_USER=BD_admin
+BD_ADMIN_PASSWORD=
# The name of the schema that will be created to host all of the
# ORDS Concert App database objects.
SCHEMA_NAME=ORDS_CONCERT_APP
SCHEMA_PASSWORD=
-# Your Auth0 tenant JWT credentials, used by ORDS to validate request to protected endpoints.
-JWT_ISSUER=https://my-domain.auth0.com/
-JWT_VERIFICATION_KEY=https://my-domain.auth0.com/oauth/token/.well-known/jwks.json
-JWT_AUDIENCE=https://concert.sample.app
-
-# Auth0 Authentication app configuration parameters specific of the sample app.
-AUTH0_RETURN_TO_URL=http://localhost:3000
-AUTH0_CALLBACK_URL=http://localhost:3000/callback
-AUTH0_CLIENT_ID=auth0_client_id
-AUTH0_CLIENT_SECRET=auth0_client_secret
-AUTH0_DOMAIN=my-domain.auth0.com
-AUTH0_LOGOUT_URL=https://my-domain.auth0.com/v2/logout
+# OCI IAM OIDC application configuration parameters specific to the sample app.
+OIDC_RETURN_TO_URL=http://localhost:3000
+OIDC_REDIRECT_URI=http://localhost:3000/callback
+OIDC_CLIENT_ID=
+OIDC_CLIENT_SECRET=
+OIDC_AUTHORIZATION_ENDPOINT=https://:443/oauth2/v1/authorize
+OIDC_TOKEN_ENDPOINT=https://:443/oauth2/v1/token
+OIDC_USERINFO_ENDPOINT=https://:443/oauth2/v1/userinfo
+OIDC_LOGOUT_ENDPOINT=https://:443/oauth2/v1/userlogout
+OIDC_AUDIENCE=ords/sample-app/
+OIDC_SCOPES=openid,email,profile,ords/sample-app/concert_app_authuser,ords/sample-app/concert_app_admin
diff --git a/templates/ords-remix-jwt-sample/.gitignore b/templates/ords-remix-jwt-sample/.gitignore
new file mode 100644
index 0000000..7e430a1
--- /dev/null
+++ b/templates/ords-remix-jwt-sample/.gitignore
@@ -0,0 +1,20 @@
+# MacOS
+.DS_Store
+.DS_Store?
+
+# Visual Studio Code
+.vscode/
+
+# Node and NPM installation folder
+/node
+
+# Node Modules
+node_modules/
+
+# Remix
+/.cache
+/build
+/public/build
+
+# Enviorement variables
+.env
diff --git a/templates/ords-remix-jwt-sample/app/components/admin/EventForm.tsx b/templates/ords-remix-jwt-sample/app/components/admin/EventForm.tsx
index c1986fd..72ed396 100644
--- a/templates/ords-remix-jwt-sample/app/components/admin/EventForm.tsx
+++ b/templates/ords-remix-jwt-sample/app/components/admin/EventForm.tsx
@@ -10,7 +10,6 @@ import Artist from '../../models/Artist';
import EventStatus from '../../models/EventStatus';
import ORDSResponse from '../../models/ORDSResponse';
import Venue from '../../models/Venue';
-import { BASE } from '../../routes/constants/index.server';
import TooltipComponent from '../tooltips/TooltipComponent';
import featureDescriptions from '../../utils/ORDSFeaturesDescription';
@@ -34,15 +33,15 @@ function EventForm(props: EventFormProps) {
const [eventStatus, setEventStatus] = React.useState(status.items[0].event_status_id);
const handleArtistSelect = (event: React.FormEvent) => {
const target = event.target as HTMLInputElement;
- setArtist(parseInt(target.value, BASE));
+ setArtist(parseInt(target.value, 10));
};
const handleVenueSelect = (event: React.FormEvent) => {
const target = event.target as HTMLInputElement;
- setVenue(parseInt(target.value, BASE));
+ setVenue(parseInt(target.value, 10));
};
const handleStatusSelect = (event: React.FormEvent) => {
const target = event.target as HTMLInputElement;
- setEventStatus(parseInt(target.value, BASE));
+ setEventStatus(parseInt(target.value, 10));
};
return (
diff --git a/templates/ords-remix-jwt-sample/app/components/admin/VenuesForm.tsx b/templates/ords-remix-jwt-sample/app/components/admin/VenuesForm.tsx
index 015e999..e5c22d1 100644
--- a/templates/ords-remix-jwt-sample/app/components/admin/VenuesForm.tsx
+++ b/templates/ords-remix-jwt-sample/app/components/admin/VenuesForm.tsx
@@ -8,7 +8,6 @@ import { Form } from '@remix-run/react';
import React from 'react';
import City from '../../models/City';
import ORDSResponse from '../../models/ORDSResponse';
-import { BASE } from '../../routes/constants/index.server';
interface VenuesFormProps {
cities: ORDSResponse
@@ -25,7 +24,7 @@ function VenuesForm(props: VenuesFormProps) {
const handleCitySelect = (event: React.FormEvent) => {
const target = event.target as HTMLInputElement;
- setCity(parseInt(target.value, BASE));
+ setCity(parseInt(target.value, 10));
};
return (
diff --git a/templates/ords-remix-jwt-sample/app/components/artists/ArtistHome.tsx b/templates/ords-remix-jwt-sample/app/components/artists/ArtistHome.tsx
index b699b00..2ce9878 100644
--- a/templates/ords-remix-jwt-sample/app/components/artists/ArtistHome.tsx
+++ b/templates/ords-remix-jwt-sample/app/components/artists/ArtistHome.tsx
@@ -6,7 +6,6 @@
*/
import React from 'react';
import { Divider } from '@mui/material';
-import { Auth0Profile } from 'remix-auth-auth0';
import HeroBanner from './HeroBanner';
import Countdown from '../homepage/Countdown';
import Timeline from '../homepage/Timeline';
@@ -15,12 +14,13 @@ import DiscoverArtists from './DiscoverArtists';
import Artist from '../../models/Artist';
import ORDSResponse from '../../models/ORDSResponse';
import ORDSConcert from '../../models/ORDSConcert';
+import OIDCProfile from '../../models/OIDCProfile';
interface ArtistHomeProps {
artists: ORDSResponse< Artist>;
events: ORDSResponse< ORDSConcert >;
similarArtists: ORDSResponse< Artist >;
- user: Auth0Profile | null;
+ user: OIDCProfile | null;
likedArtist: boolean;
}
/**
diff --git a/templates/ords-remix-jwt-sample/app/components/artists/HeroBanner.tsx b/templates/ords-remix-jwt-sample/app/components/artists/HeroBanner.tsx
index 273f4fa..a064892 100644
--- a/templates/ords-remix-jwt-sample/app/components/artists/HeroBanner.tsx
+++ b/templates/ords-remix-jwt-sample/app/components/artists/HeroBanner.tsx
@@ -8,7 +8,6 @@ import React from 'react';
import {
Box, CircularProgress, Modal, Chip,
} from '@mui/material';
-import { Auth0Profile } from 'remix-auth-auth0';
import { Form, useNavigation, useSearchParams } from '@remix-run/react';
import Artist from '../../models/Artist';
import { modalStyle } from '../../CommonStyles';
@@ -20,10 +19,11 @@ import artistImages from '../utils/artistImages';
import artistBackgrounds from '../utils/artistBackgrounds';
import artistBioColor from '../utils/artistBioTextColor';
import artistTitleColor from '../utils/artistTitleColor';
+import OIDCProfile from '../../models/OIDCProfile';
interface HeroBannerProps {
artist: Artist;
- user: Auth0Profile | null;
+ user: OIDCProfile | null;
userLikedArtist: boolean;
}
@@ -160,7 +160,7 @@ function HeroBanner(props: HeroBannerProps) {
100 followers
-
-