<@U04UQ68083H> I use ory proxy. When I call `.ory/...
# ory-copilot
q
@chilly-king-10285 I use ory proxy. When I call
.ory/self-service/login/browser?refresh=true
it returns a response with the request_url field with my domain in http rather than https. How can I force it to return an https endpoint?
b
A message from kapa.ai
New message text here
q
I run ory proxy in a ec2 instance. The requests a proxied from a load balancer which maps the https request to the ec2 instance as http. I need a way to tell ory proxy that everything should be interpreted as https. Can anyone help please?
@chilly-king-10285 I have an ory proxy running with this command:
Copy code
ory proxy <http://localhost:8000> <https://staging.auth.domain.co.uk> --project peaceful-cannon-4isvhsypte --cookie-domain <http://staging.auth.domain.co.uk|staging.auth.domain.co.uk> --allowed-cors-origins <https://staging.auth.domain.co.uk:8000> --allowed-cors-origins <https://staging.portal.domain.co.uk> --default-redirect-url <https://staging.portal.domain.co.uk>
THe proxy is running in an ec2 instance in the https://staging.auth.domain.co.uk domain but I redirect it to https://staging.portal.domain.co.uk. However when I get redirected to https://staging.portal.domain.co.uk the cookie is not being used by the browser.
b
A message from kapa.ai
The issue you're experiencing might be related to the domain settings for your cookies. When setting cookies, the domain must match the domain of your application. If the domains don't match, the browser will ignore the cookies, which could prevent your application from functioning properly. In your command, you're setting the
--cookie-domain
to
<http://staging.auth.domain.co.uk>
. However, cookies are typically set to the top-level domain. For example, if your application is running on
<https://app.example.org>
, you would set
--cookie-domain
to
<http://example.org|example.org>
[source](https://www.ory.sh/docs/cli/ory-tunnel#cookies). Also, note that cookies ignore the port number. A cookie set with
Set-Cookie: <name>=<value>; domain=<http://example.org:1234|example.org:1234>
will be sent to
<https://example.org:443>
,
<http://example.org:80>
, and
<http://api.example.org:1234>
[source](https://www.ory.sh/docs/security-model#http-cookie-domains). Furthermore, the
--allowed-cors-origins
flag should be set to the domain that will be making requests to your Ory Proxy. In your command, you're setting
--allowed-cors-origins
to
<https://staging.auth.domain.co.uk:8000>
and
<https://staging.portal.domain.co.uk>
. If these domains are not making requests to your Ory Proxy, you might need to adjust this setting. Lastly, ensure that your application and Ory Proxy are available on the same domain. Cookies work best on the same domain, and running them on separate subdomains or different domains can cause issues [source](https://www.ory.sh/docs/kratos/debug/csrf#common-issues). If you continue to experience issues, I recommend referring to the [Ory documentation](https://www.ory.sh/docs/guides/cli/proxy-and-tunnel) or seeking assistance from the Ory community or support channels.
q
@chilly-king-10285 I run this command: ory tunnel --dev http://localhost:5173 --allowed-cors-origins http://localhost:8000 --allowed-cors-origins http://localhost:4000 --allowed-cor s-origins http://localhost:5173 http://localhost:8000 But the browser won't use the auth cookie when calling from my front end website that runs on http://localhost:5173
b
A message from kapa.ai
The issue you're experiencing might be related to the domain settings for your cookies and the configuration of your Ory Tunnel. When setting cookies, the domain must match the domain of your application. If the domains don't match, the browser will ignore the cookies, which could prevent your application from functioning properly. In your command, you're running the Ory Tunnel with the
--dev
flag and setting
--allowed-cors-origins
to
<http://localhost:8000>
,
<http://localhost:4000>
, and
<http://localhost:5173>
. This means that these domains are allowed to make requests to your Ory Tunnel. However, you're running your frontend website on
<http://localhost:5173>
. If your Ory Tunnel is not running on the same domain (in this case,
localhost
), the browser might not be able to use the auth cookie. Here are a few things you can check: 1. Ensure that your application and Ory Tunnel are running on the same domain. Cookies work best on the same domain, and running them on separate subdomains or different domains can cause issues [source](https://www.ory.sh/docs/kratos/debug/csrf#common-issues). 2. Check your browser's settings to ensure that it's not blocking cookies from
localhost
. 3. Review the settings of your Ory Tunnel and your application to ensure that they're correctly configured to use cookies. If you continue to experience issues, I recommend referring to the [Ory documentation](https://www.ory.sh/docs/cli/ory-tunnel) or seeking assistance from the Ory community or support channels.
q
@chilly-king-10285 how do I set my ory proxy to set the auth cookie SameSite field to none
b
A message from kapa.ai
New message text here