Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

contents of path :realm_uri/".well-know/openid-configuration" does not contain PUBLIC_KEY in keycloak ver. 18 #57

Open
softdev45 opened this issue Jun 21, 2022 · 2 comments

Comments

@softdev45
Copy link

url=f"{self.realm_uri}/.well-known/openid-configuration",

@softdev45 softdev45 changed the title Path ".well-know/openid-configuration" does not exist in keycloak ver. 18 Path ".well-know/openid-configuration" does not contain PUBLIC_KEY in keycloak ver. 18 Jun 21, 2022
@softdev45 softdev45 changed the title Path ".well-know/openid-configuration" does not contain PUBLIC_KEY in keycloak ver. 18 contents of path :realm_uri/".well-know/openid-configuration" does not contain PUBLIC_KEY in keycloak ver. 18 Jun 21, 2022
@yannicschroeer
Copy link
Collaborator

That's unfortunate. We are aware that this package currently only fully works with Keycloak v16.
We're open to proposals on how to support multiple versions without blowing the whole thing up

@zulrang
Copy link

zulrang commented Jul 26, 2022

It works fine for Keycloak v18:

    @functools.cached_property
    def public_key(self) -> str:
        """Returns the Keycloak public key

        Returns:
            str: Public key for JWT decoding
        """
        response = requests.get(url=self.realm_uri, timeout=self.timeout)
        public_key = response.json()["public_key"]
        return f"-----BEGIN PUBLIC KEY-----\n{public_key}\n-----END PUBLIC KEY-----"

This gets the public key

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants