Hello, Can you please tell me if it is possible t...
# talk-kratos
t
Hello, Can you please tell me if it is possible to place authorization UI and Kratos on different ports of
127.0.0.1
without proxying
127.0.0.1:4433 -> 127.0.01:3000/api/.ory
? I am using the React/Nextjs template (
127.0.01:3000
) and Kratos running in Docker (
127.0.0.1:4433)
. I'm trying to change the
basePath
of
Configuration
of
V0alpha2Api
to
<http://127.0.0.1:4433>
, but I get Network Error. The reason why I don't want to do a proxy to redirect the requests from
/api/.ory
to
127.0.0.1:4433
is because during development I want to run several different react applications on different ports which communicate with the same server and therefore should use a single authorization (which I plan to implement as a separate react application) and I don't want to add route
/api/.ory
to each of those applications to be able to authorize in dev mode. (in a product build applications will be placed on their own paths of the same domain and I don't mind adding a proxy for
<http://domain.com/api/.ory|domain.com/api/.ory>
, but I would like to avoid this for each individual application). Can you please tell me if there is any solution to this problem with Ory Kratos? Thank you!
@bland-eye-99092, @steep-lamp-91158, Could you please take a look once you have a time? Thank you 🙏
I think before that I checked with
localhost
, and not with
127.0.0.1
, because now I get CORS error. If I use the "Allow CORS" extension, then everything works. Accordingly, the question now boils down to how to deal with this CORS error (use the
same-site
, instead of the
same-origin
). Could you please tell me if there is a solution?
s
Maybe use subdomains instead? Also, cookies are not port but only host specific? https://stackoverflow.com/questions/1612177/are-http-cookies-port-specific
t
@steep-lamp-91158 thank you Patrik! I found the right solution. Simply, Kratos must be added to the backend api gateway 🙂 Regardless of whether the backend is deployed locally or on a remote server