Repository navigation
Replies: 29 comments 39 replies
I am not sure if we need also the option My point is, that Keycloak built-in JS applications I see the approach you described above (single callback URL for the client with path handled in the For example can we do something in our keycloak.js adapter, which will make sure that adapter will "handle" URL like: and translate it to the URL like: If not, we may need to have this
This is more generic question, but how exactly we detect that Keycloak should use development mode? Will it be strictly hardcoded to the quarkus
|
|
I would like to see option for my current permitted scheme: |
|
The comments on #8187, especially #8187 (comment) are spot-on for our use case here, where we want to deploy our UIs automatically in branches and we have dynamic URLs under our top domain, so allowing wildcards in hosts is a must for testing, and we certainly don't want the too general '*'. |
|
To add to that we would like to support Vercel preview deployments. For it's preview deployments Vercel uses a (partially) random subdomain: We would also understand that from a security perspective that wouldn't be ideal, but this can be noted in the documentation. |
|
Hi, thanks for considering this feature. I wanted to add another production use case for wildcarding subdomains to hopefully help prioritise this work. In my case keycloak is almost working great as a single sign on for kubernetes clusters with ISTIO and oauth2-proxy. We have control over our domains, and have new services being spun up dynamically on subdomains multiple times daily. Everything authenticates via Keycloak using a single client. Great! Any ideas on better approaches would really be appreciated. |
|
I'd like to add 2 use cases from my side. Case 1 Can I configure it like Case 2 Can I configure it like |
|
I'm in the process of migrating some applications from Auth0 onto a Keycloak platform. We're used to being able to specify a wildcard in the subdomain that we use for various testing environments on a non-production tenant. I think the rules around its usage sound reasonable to me: https://auth0.com/docs/get-started/applications/wildcards-for-subdomains#wildcard-url-placeholders I'm trying to recreate the same ability in a non-production Keycloak realm, but it looks like I'd have to use |
|
Is anyone interested in working on this one? I don't think it would take all that much effort to get something sorted out. I think we can break this into: Redirect URI Client Policy ExecutorImplement a configurable Redirect URI client policy that allows configuring the policy around redirect-uris, maybe options like:
The client policy would only check the configured redirect-uris for a client when created or updated. Support wildcard in hostMake it possible to configure a redirect-uri with a wildcard in the hostname part. I think this is basically what #14118 has done. Additional client policy conditionsWe may want some addition client policy conditions for example by client-id like what's done in #8236 Out of the box configurationWe should probably consider adding some out of the box configuration around this, maybe some built-in client policy profiles. Maybe also have something enabled by default for all clients, and perhaps that could vary if you are running in dev-mode (start-dev) or prod mode (start). |
|
After this too, for compatibility with Coolify PR previews, formatted as |
|
Hey everyone! Is this still being worked on? I'm very interested in being able to use wildcards in the hostname for a multi-tenant app, e.g. I'd be happy to help too! |
|
Tangentially related: the Elytron client built into Wildfly has decided to simply strip query parameters from the redirect_uri (client-side) in response to the OAuth Best Practices mentioned above. That obviously causes havoc (and still is). See: https://issues.redhat.com/browse/WFLY-17324 and https://issues.redhat.com/browse/ELY-2340 |
|
Are there people using |
|
Hey. Being able to use wildcard for subdomain is very interesting to us. Being able to provision nodes (xyz.app.qwop.com) without also editing the oidc client configuration would be wonderful. Is there any movement on this @stianst ? |
|
Hi! Being able to use wildcard for subdomain is very crucial to us. @stianst any updates here? |
|
Here is another use case, we use deploy previews for netlify which have the following stucture: |
|
Good afternoon, honored ones! This topic is already a year and a half old. Could you please tell me if there is any solution to this issue? I would like to be certain about the issue. |
|
No updates for #14380. So I guess the implementation never really started. Subdomain wildcards are an important missing functionality, I can't switch to Keycloak until it's implemented. And I bet many homelabbers are in the same position. Hope there will be some progress...thanks for creating Keycloak, it's a nice product, hope one day I'll be able to replace Authelia with it. :) |
|
The ability to use wildcards in redirect URIs would be also of great importance to us. +1 on this topic 👍 |
|
is there any ETA on the wildcard topic (espacially for the hostname part)? I've read all related discussions but I'm not sure what's next. I would be able to contribute if help is needed |
|
Seems like #25316 will solve most if not all issues discussed here in keycloak version 24 |
Very interesting but I don't see such subdomain wildcard related to OAuth 2.1 |
|
Thank you very much, I see. |
|
Damn, I was waiting for it :) |
|
Any progress here? thanks 👍 |
|
I am interested in the progress, too. Didn't read all the PRs, Issues and the like which seems quite extensive. To allow subdomains like For us this is really cumbersome since a partner is hosting the service with a keycloak. So we have to write them every time a new system is installed so that they add it to the client: systema.domain.com/app |
|
Hello, |
|
Looks like there is still no progress. Adding dozens or 100s of subdomains not only is very manual work heavy, it also bloats JWT - they become massive with all the individual URLS present. This further leads to header size issues. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Keycloak currently allows wildcards in the redirect-uri by default, and allows any scheme to be used in redirect URLs as well. Some examples of valid redirect-uris that can be configured for clients:
*https://example.com/app/*custom://somethingThis can lead to insecure configurations that are open to a number of vulnerabilities. For more details refer to OAuth 2.0 Security Best Current Practice.
The OAuth 2.0 Security Best Current Practice and OAuth 2.1 adds more restrictions on matching of redirect-uris, and suggests that they should always be a strict string comparison, without allowing any patterns to be registered in the client configuration.
However, there are some use-cases when this strict string comparison is problematic, for example:
https://{instance}.theapp.com)In addition the Keycloak client adapters themselves have been implemented badly from this perspective. Keycloak adapters allow any URL of the client to serve as the OAuth callback endpoint, which is the reason for supporting wildcards in the context-path in the first place. According to best-practices there should be a dedicated OAuth callback endpoint (
https://myapp.com/oauthcallbackfor example), while the application can then leverage thestateparameter to encapsulate what page the user should be redirect to after handling the callback.By leveraging client policies we can allow both for security as well as flexibility. Allowing configuring different client policies for different clients. Where examples of options can be:
The Open redirect option should only be available in developer environments, where for the Keycloak.X distribution there is now an explicit option to run the server in production mode or development mode that can enable/disable this option.
The Wildcard in subdomains options should only be enable for clients that explicitly requires this, and should not be enabled by default, or for most clients.
In summary by default in developer mode we should permit wildcards in redirect-uris, while in production no wildcards should be permitted at all, and it should be easy to allow wildcards in subdomains or context-paths for individual clients (or groups of clients) that require it.
The next thing we should consider is the scheme that is permitted. According to best practices custom scheme should not be permitted, and
httpsis the only scheme that should be used. Again, this may be too restrictive in practice, so we should again leverage client policies to allow configuring this. Options for permitted schemes should include:In developer mode both https and http should be available, while in production mode by default only https. For native applications that are using custom schemes as redirect-uri they should ideal be improve to not leverage these, but it should be possible for an admin to explicitly allow custom schemes for specific clients.
All reactions