Skip to content

Commit

Permalink
Keycloak: fix default realm handling
Browse files Browse the repository at this point in the history
  • Loading branch information
NotActuallyTerry authored Jun 1, 2024
1 parent 13b6e7c commit d7e3060
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions githubapp/keycloak.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def __init__(self):
if not os.environ.get("KEYCLOAK_PASSWORD", None):
raise Exception("KEYCLOAK_PASSWORD not defined")

if not os.environ.get("KEYCLOAK_REALM"):
os.environ["KEYCLOAK_REALM"] = "master"

if not os.environ.get("KEYCLOAK_ADMIN_REALM"):
os.environ["KEYCLOAK_ADMIN_REALM"] = os.environ.get("KEYCLOAK_REALM")

Expand All @@ -29,8 +32,8 @@ def __init__(self):
server_url=os.environ["KEYCLOAK_SERVER_URL"],
username=os.environ["KEYCLOAK_USERNAME"],
password=os.environ["KEYCLOAK_PASSWORD"],
realm_name=os.environ.get("KEYCLOAK_REALM", "master"),
user_realm_name=os.environ.get("KEYCLOAK_ADMIN_REALM", "master")
realm_name=os.environ["KEYCLOAK_REALM"],
user_realm_name=os.environ.get["KEYCLOAK_ADMIN_REALM"]
)

def get_group_members(self, group_name: str = None):
Expand Down

0 comments on commit d7e3060

Please sign in to comment.