From 96577e5927445dedad37eeee5b4549c17d834a99 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Mon, 18 Mar 2024 03:42:44 +0100
Subject: [PATCH] WIP: OAuth authn

---
 pages/api/auth/[...nextauth].ts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts
index 32e8c6e..15458c5 100644
--- a/pages/api/auth/[...nextauth].ts
+++ b/pages/api/auth/[...nextauth].ts
@@ -7,9 +7,8 @@ const issuer = 'https://keycloak.sso.gwdg.de/auth/realms/academiccloud'
 
 async function refreshAccessToken (token: any) {
   try {
-    const url =
-      issuer + '/protocol/openid-connect?' +
-      new URLSearchParams({
+    const url = issuer + '/protocol/openid-connect/token'
+    const params = new URLSearchParams({
         client_id: clientId,
         client_secret: clientSecret,
         grant_type: 'refresh_token',
@@ -21,6 +20,7 @@ async function refreshAccessToken (token: any) {
         'Content-Type': 'application/x-www-form-urlencoded'
       },
       method: 'POST'
+      body: params
     })
 
     const refreshedTokens = await response.json()
-- 
GitLab