-
So, after much frustrations with the inadequate examples for moving to a custom domain and outside of the local / proxy world, I seem to have "some of it working" but there seems to be missing session data. I'll explain: I setup a custom domain, DNS & CNAME records for a ory.my-domain-example.app that points to my instance on Ory Cloud. I built the local GoLang app that serves from www.my-domain-example.app:3443 [ i.e. it's on 127.0.0.1 ] and I setup SSL because it is required with all new browsers that use a .app TLD. All of this works. When I access https://www.my-domain-example.app:3443 I get redirected to the login page on the Ory Cloud, located at ory.my-domain-example.app/ui/login?flow=0ab92142-c2e3-4a23-8a72-32a7fa9a410f with the login page. All good so far! Yeah! Then I login, which is successful. The Ory Cloud sends me BACK to my app after, which then goes through code looking to see if I have a cookie and then extracting the session. There is a cookie, but there is NO session details, which means the code in this test fails......
....and it does a Redirect again, which, because the Ory Cloud knows there is a session, it takes me to the https://ory.my-domain-example.app/ui/welcome page. This seems like normal behavior, but I would never execute this additional Redirect IF I had proper session data. Why and I not getting proper session data passed back into me after the re-direct from the Ory cloud to my app, after a successful login? I suspect it has something to do with cross domain cookies, but I don't know how / where I should change something if that is the case. The only place for setting that is in the Custom Domain configuration page. I have my Domain set to [ ory.my-example-domain.app ] and I have my Cookie Domain set to [ my-domain-example.app ] in my Custom Domain settings. I have CORS enabled and I have Orgins set to [ https://*.my-domain-example.app ] at the bottom. What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @wgbdev I will take a look at this today to see if I can reproduce it. It's probably something where the Go application is not including the cookie when requesting for the session information. Just a few questions so I can understand the context a bit better :)
|
Beta Was this translation helpful? Give feedback.
-
Still working on this problem.... I "think" it has something to do with the following failing... session, _, err := app.ory.V0alpha2Api.ToSession(request.Context()).Cookie(cookies).Execute() I suspect, which doesn't seem to be documented anywhere that this call is looking for something other than the Cookie being passed in to validate a session. Do I need a TOKEN of some sort? If so, where and how do I set it? Where is the documentation that I missed on this? Perhaps I'm all off base, but I will soldier on..... perhaps it's me.... perhaps it's a bug.... perhaps it's poor documentation or bad examples.... life of open source software it NOT for the faint of heart.... I'm truly open for suggestions or paying $ for someone to help me understand why the tutorials don't work.... |
Beta Was this translation helpful? Give feedback.
-
Problem is fixed. My bug. I was improperly setting the URL for the app.ory.V0alpha2Api.ToSession() command by passing the wrong data to c.Servers = ory.ServerConfigurations{{URL: fmt.Sprintf("https://ory.my-domain-example.app" )}} |
Beta Was this translation helpful? Give feedback.
Problem is fixed. My bug. I was improperly setting the URL for the app.ory.V0alpha2Api.ToSession() command by passing the wrong data to c.Servers = ory.ServerConfigurations{{URL: fmt.Sprintf("https://ory.my-domain-example.app" )}}