From b003a152096b7829596b5842c5749d912690ab62 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Thu, 14 Mar 2024 12:16:54 +0100
Subject: [PATCH] WIP: deployable

---
 Dockerfile                      |  2 +-
 pages/api/auth/[...nextauth].ts | 11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 4b6488e..e24a507 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -23,8 +23,8 @@ EXPOSE 3000
 
 ENV PORT 3000
 ENV HOSTNAME "0.0.0.0"
-
 ENV EXPRESS_PUBLIC_API_URL=http://localhost:8000/api
+ENV KEY_CLOAK_CLIENT_SECRET
 CMD ["npm", "run", "dev"]
 
 #ENV EXPRESS_PUBLIC_API_URL=http://localhost:8000/api
diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts
index aae8fd3..1bf718c 100644
--- a/pages/api/auth/[...nextauth].ts
+++ b/pages/api/auth/[...nextauth].ts
@@ -15,10 +15,13 @@ export const authOptions = {
   providers: [
     // !!! Should be stored in .env file.
     KeycloakProvider({
-      clientId: 'fdo-manager-webui',
-      clientSecret: 'ay7l6jhECSohAZsEp6HYOaoXdARMQCei',
-      issuer: 'http://localhost:8000/auth/realms/fdo-manager',
-      authorization: { params: { scope: 'openid profile' } },
+      //clientId: 'fdo-manager-webui',
+      clientId: 'gwdg-fdoman-test',
+      //clientSecret: 'ay7l6jhECSohAZsEp6HYOaoXdARMQCei',
+      clientSecret: process.env.KEY_CLOAK_CLIENT_SECRET,
+      // issuer: 'http://localhost:8000/auth/realms/fdo-manager',
+      issuer: 'https://keycloak.sso.gwdg.de/auth/realms/academiccloud',
+      //authorization: { params: { scope: 'openid profile email' } },
       profile (profile) {
         console.log('### profile', profile, '### ### ###')
         return {
-- 
GitLab