silly-evening-67657
05/09/2023, 6:49 AMproud-plumber-24205
05/09/2023, 9:55 AMproud-plumber-24205
05/09/2023, 9:56 AMsilly-evening-67657
05/09/2023, 10:32 AMproud-plumber-24205
05/09/2023, 11:21 AMbase_url/login?flow=?
if you are using the latest version (v0.13.0).
As for the redirect back to localhost, this can only work if you are rewriting the cookies and URLs for the localhost client from kratos. I'm assuming you have Kratos hosted on a domain (example.com) and you want to do local testing against it?melodic-thailand-6910
05/09/2023, 11:54 AMstate
query from OIDC flow.
Later we use this to correctly redirect user to either localhost or example.com
Basically, requests are always going to example.com/.kratos/xxxx, but depends on the value in the state map, we are redirecting to localhost/.ory/xxx or example.com/.ory/xxx
On local, we created a proxy to handle that.
Our local proxy, proxies requests to example.com/.ory
When user redirected to localhost, we successfully write cookies.
For example example.com//self-service/methods/oidc/callback/:provider
Does the following redirect:
const redirectURI = StateMap.get(state);
res.redirect(
`${redirectURI}.ory/self-service/methods/oidc/callback/${provider}?${new URLSearchParams(
query,
)}`,
redirectURI is localhost in that case, and we have proxy redirecting .ory
to remote ORY installation.
So when user redirected to this URL(example.com/.ory/xxx), we are getting redirect uri from this map (localhost/.ory/xxx).
This works fine as. long as we have state
, but however, when there is an error, it redirects and creates registration flow and starts a new one redirects to example.com/registration (Set from kratos URL)
We think about to use continuity token for this case, for example, when user started the flow, we keep continuity token in the Map and record it';s referrer. If we are redirected to this URL, get referer from map and redirect user either to localhost/xxx or example.com/xxx, so cookie rewrites will work.melodic-thailand-6910
05/09/2023, 11:55 AMproud-plumber-24205
05/09/2023, 12:21 PMmelodic-thailand-6910
05/09/2023, 12:28 PMproud-plumber-24205
05/09/2023, 12:35 PMsilly-evening-67657
05/09/2023, 1:33 PM