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

Allow multiple auth-server-urls #480

Open
sebaspf opened this issue Mar 31, 2023 · 1 comment
Open

Allow multiple auth-server-urls #480

sebaspf opened this issue Mar 31, 2023 · 1 comment

Comments

@sebaspf
Copy link

sebaspf commented Mar 31, 2023

Description

When using CNAMEs to point to the Keyclaok server, the JWT created has in the iss field the CNAME. As the KC Server can be react over both addresses, the auth-server-url field of the Config must take this into account. In the code line

} else if (token.content.iss !== this.realmUrl) {
the request will be rejected if they come form the CNAME URL of the URL the CNAME Points to.

Proposal
Type for backwards compatibility:

type auth_server_url_type: string | string[]

Usgage:

let iss = new URL(token.content.iss)
if ((typeof this.config.realmUrl) === "string") {
  // Use like until now
} else if (Array.isArray(this.config.realmUrl) {
  if (this.config.realmUrl.includes(iss.host) && (iss.pathname === ''/realms/' + this.config.realm) // Accept/Reject
} else {
  // Error (the Config class constructor should check this)
}

Discussion

No response

Motivation

No response

Details

No response

@sbabych
Copy link

sbabych commented Jan 26, 2024

Hi, pls take a look at #308
imo this is a correct approach for the multiple auth-server-urls.
Unfortunately it is already open for 2years at least

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

2 participants