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

Port number problem in post_logout_redirect_uri with ipv6 addresses #424

Open
acerola1 opened this issue Sep 13, 2022 · 0 comments
Open

Comments

@acerola1
Copy link

Describe the bug

In a corporate cloud environment we use ipv6 addresses. When the redirect uri is not defined keycloak-connect create a redirect-ui based on the request host for the logout. When the host is an ipv6 address, then parsing out the port number is not working right. It adds part of the ipv6 address instead of the real port number.

Version

19

Expected behavior

When the host of the request is an ipv6 address like [2001:db8:4006:812::200e]:8080 then the generated post_logout_redirect_uri should be [2001:db8:4006:812::200e]:8080

Actual behavior

Now the generated post_logout_redirect_uri is [2001:db8:4006:812::200e]:db8

How to Reproduce?

It is hard to reproduce, because it is not a normal use case that you use ipv6 ip address for a website. I think in out case it is caused by some kind of proxying inside the cloud environment. But it is a simple parsing problem. The port parsing for ipv6 should be different. Something like this.

let getPort = (url) => {
    let res;
    if (isIpv6Address(url)) {
        res = url.split(']');
        res = res[1].split(':');
    } else {
        res = url.split(':');
    }
    return res[1] || '';
} 

Anything else?

No response

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

No branches or pull requests

1 participant