Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug introduced by Keycloak 18+. #71

Open
nunopedrosa opened this issue May 20, 2022 · 0 comments
Open

Bug introduced by Keycloak 18+. #71

nunopedrosa opened this issue May 20, 2022 · 0 comments

Comments

@nunopedrosa
Copy link

Keycloak 18 not longer supports redirect_uri parameter on logout and fails with an error:
See: https://www.keycloak.org/docs/latest/upgrading/index.html#openid-connect-logout

So, in KeycloakService.php, ** getLogoutUrl** should be something like:

public function getLogoutUrl() {
        $url = $this->getOpenIdValue('end_session_endpoint');

        if (empty($this->redirectLogout)) {
            $this->redirectLogout = url('/');
        }
        $params = [
            'client_id' => $this->getClientId(),
            #'redirect_uri' => $this->redirectLogout, # This is no longer supported and needs to be excluded
        ];
        $idToken= session()->get('keyIdToken'); # There is surely a better way to find the token...

        if (!empty($idToken)) {
            $params['post_logout_redirect_uri']= $this->redirectLogout; # These are the new optional Keycloak parameters
            $params['id_token_hint'] = $idToken; # These are the new optional Keycloak parameters
        }
        return $this->buildUrl($url, $params);
    }

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

No branches or pull requests

1 participant