From bba8bfec21d26bc06fe25a3b2ecb827b80fc0fb1 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Wed, 28 Jun 2023 10:55:12 +0000
Subject: [PATCH] GitHub Actions: add "contents: write" permission for update-deps job

---
 src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java
index 2448808..041303e 100644
--- a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java
+++ b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocolService.java
@@ -12,11 +12,9 @@
 import javax.ws.rs.core.*;
 
 public class CASLoginProtocolService {
+    private KeycloakSession session;
     private RealmModel realm;
     private EventBuilder event;
-
-    @Context
-    private KeycloakSession session;
 
     @Context
     private HttpHeaders headers;
@@ -24,8 +22,9 @@
     @Context
     private HttpRequest request;
 
-    public CASLoginProtocolService(RealmModel realm, EventBuilder event) {
-        this.realm = realm;
+    public CASLoginProtocolService(KeycloakSession session, EventBuilder event) {
+        this.session = session;
+        this.realm = session.getContext().getRealm();
         this.event = event;
     }
 
@@ -35,7 +34,7 @@
 
     @Path("login")
     public Object login() {
-        AuthorizationEndpoint endpoint = new AuthorizationEndpoint(realm, event);
+        AuthorizationEndpoint endpoint = new AuthorizationEndpoint(session, event);
         ResteasyProviderFactory.getInstance().injectProperties(endpoint);
         return endpoint;
     }

--
Gitblit v1.9.1