Hi, I'm having trouble getting the Ory proxy to wo...
# ory-network
a
Hi, I'm having trouble getting the Ory proxy to work with Ory cloud. I've followed the instructions https://www.ory.sh/docs/start-building/server-side-web-app/ and the proxy is not injecting the JWT into the headers when debugging the Express App. I've tried setting the SDK URL explicitly and as an environment variable:
Copy code
ory proxy --sdk-url=<https://romantic-bhaskara-tctyd7320b.projects.oryapis.com> --port 4000 <http://localhost:8000/>
When I navigate to localhost:4000 and login it keeps redirecting me back and I can't view the protected page. Debugging the node app shows the session cookie is there but not the expected JWT token. Please advise, as I feel like I'm going round in circles. I'm on windows and I installed ORY CLI with scoop. Many thanks in advance.
m
Thanks for the report Jacob, I will see if I can replicate the issue.
p
I wasn't able to reproduce it
maybe try restart the proxy and the node application?
Also, which version of the Ory Proxy are you running?
a
Thanks for responding so quickly. I have tried restarting a few times. How do I get the version of the proxy?
p
ory version
a
Copy code
$ ory version
Version:    v0.1.0
Git Hash:   d452feb536c3d488ef5b7cd34ce63f90b3140d1f
Build Time: 2021-11-07T19:00:50Z
p
Yeah that looks alright 🙂 So you're saying that after the user logs in the browser redirects back to the node application "dashboard" and when clicking on
/protected
it takes you back to the dashboard?
a
yes exactly
p
which browser are you using? and have you tried clearing cookies / running in incognito mode?
a
I have tried different browsers and clearing cookies
Sorry to be clear when clicking on protected it sends you here:
But I'm already logged in. When clicking "Sign in" it takes you back to here:
message has been deleted
I've tried both Firefox and Chrome
Here are the cookies, you can see the ory_session_ cookie:
message has been deleted
m
here are my cookies 🍪
a
Looks similar to mine. Is there any config in the cloud I'm missing? Is there something I need to do with the Personal Access Token? The instructions say to generate one but doesn't say what to do with it?
p
No you don't need any special configuration in the cloud, as for the Personal Access Token, in this instance it's not needed. Only when preforming admin api tasks
a
That's what I thought. Is there a verbose logging mode for the proxy so we can see what it's doing?
p
maybe this is a windows specific problem with the proxy. I'll have to quickly test it on windows to confirm this. No there is no verbose mode on the cli currently, however, everything is logged in the browser (such as network requests and redirects).
a
Thanks for that. I can see the network requests but would perhaps be useful to see what the proxy was doing, whether it had found the session cookie and had created the JWT.
m
You still stuck here Jacob? I can do tests later today on a windows machine.
a
Kind of - in the end I gave up Ory cloud and just started using it locally through docker which works nicely. Is better as I get more of an understanding of how it works. Still would suggest you investigate and would be interested to know whether you reproduced it.
m
Definitely, will fire up the ol’ Win10 in the afternoon 🤓
Sorry I had some problem with my workstation and then forgot about this 😓 I am getting the exact same behaviour, i sign up, get a session and then when I go to /protected again I end up at the dashboard. trying a few things now.
Could not figure it out how to fix, but I was able to reproduce  @alert-garage-71924s problem. I am running the expressJs app in WSL and the proxy in windows shell, but that should not be a problem I think. Do you have an idea how to debug this @proud-plumber-24205? I am having trouble with Windows 😅
p
This is probably to do with the proxy code itself and how it interacts with windows. We will have to open a bug report for further investigation.
I have opened an issue and is tracked here https://github.com/ory/cli/issues/132