Repository navigation
Using cookies in HTTP environment, rather than HTTPS? #36631
Replies: 2 comments 4 replies
|
Linking to #35160 as well.
The secure option is being determined here: based upon the incoming request. The expectation is that secure HTTP can only be from localhost and only for non-safari browsers, so the request that you are showing to localhost:8080 is considered secure.A request to http://192.168.80.20:30350 will not pass that check, so the cookies are not marked as secure and you get the warning in the logs.
Is this for development only? |
I don't think that is currently supported. There could be a case to be made for the non-localhost development experience to support this - either just for start-dev or for any start with https is not enabled.
No, the cluster local hostname will not be treated the same as localhost. I think this discussion here, on #35160, and on #36094 can be summarized as follows:
@vmuzikar does this match your understanding as well? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
Hello, I am struggling with cookies in HTTP and HTTPS environments in Keycloak, along with integrating it with Apicurio Registry.
Problem
The most significant issue is whether Keycloak offers any cookies without the
secureoption, which I believe can be used in an HTTP environment. When I tested with a temporary client_id, I found that certain cookies were generated, all of which had thesecureoption enabled.Test
I found that certain cookies are generated, such as
AUTH_SESSION_ID and KEYCLOAK_IDENTITY, after completing the authentication process with a user ID and password in theapicuriorealm.When integrating w/ apicurio-registry
Yet, all of these cookies have the
secureoption, making them unavailable in an HTTP environment. The browser blocked the session when I tested by approaching apicurio-registry, believing that it would redirect to keycloak address.Error log:
ERR_CONNECTION_REFUSEDWhat concerns me is that my previous planned process involved integrating Keycloak with Apicurio Registry. Since the environment is not based on HTTPS, I believe the browser will block these cookies due to the
secureoption.The reason I am using an HTTP environment is that I am working with Kubernetes and accessing these services via a NodePort configuration. Therefore, I strongly prefer to use the following addresses as much as possible.
http://192.168.80.20:30349/ui/artifactshttp://192.168.80.20:30350Currently, I am struggling with this error, which I understand is related to #36094 (reply in thread). I created adequate client_id and realm, and integrated with apicurio-registry, but I'm stuck with this log.
I suspect that the cookies are being generated but are blocked by the browser because all of them have the
secureoption enabled.apicurio-registry instance
apiVersion: registry.apicur.io/v1 kind: ApicurioRegistry metadata: name: apicurio-registry spec: configuration: security: keycloak: url: "http://192.168.80.20:30350" realm: "apicurio" uiClientId: "apicurio-registry" apiClientId: "registry-api"log
Possible Solutions?
Here is what I am considering:
secureoption before they are generated?I am currently stuck on this issue, so I would deeply appreciate your thoughts and guidance.
Thank you.
All reactions