bland-kitchen-870
02/13/2025, 9:58 AM<http://localhost:9080/kratos/self-service/>
). When I try to resend a verification code, everything works as expected. However, if the verification flow has timed out, the updateVerificationFlow
function redirects to:
<https://localhost:4433/self-service/verification/flows?id=24ae8c74-c29e-480a-93f2-4444ed3be292>
I'm not sure why it's redirecting to localhost:4433
instead of my expected URL. How can I override this behavior in the configuration?
My client SDK configuration
const ory = new FrontendApi(
new Configuration({
basePath: "<http://localhost:9080/kratos>",
baseOptions: {
withCredentials: true,
},
})
);
brief-egg-61061
02/13/2025, 9:58 AMbrief-egg-61061
02/13/2025, 9:58 AMselfservice.flows.verification.ui_url
setting in your Kratos configuration. This setting determines where Kratos redirects for verification flows. Here's how you can override this behavior: 1. In your Kratos configuration file (usually kratos.yml
), add or modify the following section: yaml selfservice: flows: verification: ui_url: <http://localhost:9080/your-verification-ui-path>
Replace <http://localhost:9080/your-verification-ui-path>
with the actual URL where your verification UI is hosted. 2. You can also set this configuration using an environment variable: SELFSERVICE_FLOWS_VERIFICATION_UI_URL=<http://localhost:9080/your-verification-ui-path>
By setting this configuration, you're telling Kratos where to redirect for verification flows, which should prevent the unexpected redirect to localhost:4433
. The reason you're seeing a redirect to localhost:4433
is likely because this is the default value when the ui_url
is not explicitly set in your configuration. Kratos uses this as a fallback URL for the verification UI. For more details on configuring the verification flow UI URL, you can refer to the [Ory Kratos Fallback Documentation](https://www.ory.sh/docs/kratos/fallback/verification). Remember to restart your Kratos instance after making changes to the configuration for them to take effect.bland-kitchen-870
02/13/2025, 10:00 AMverification:
enabled: true
ui_url: <http://127.0.0.1:4455/verification>
lifespan: 10s
use: code
brief-egg-61061
02/13/2025, 10:00 AMbrief-egg-61061
02/13/2025, 10:01 AMserve.public.base_url
is set correctly in your Kratos configuration. It should point to the URL where Kratos is publicly accessible. For example: yaml serve: public: base_url: <http://127.0.0.1:4455/>
This is mentioned in the [Ory Kratos deployment guide](https://www.ory.sh/docs/kratos/guides/deploy-kratos-example#configure-user-interface). 2. Verify your Nginx configuration: If you're using Nginx as a reverse proxy, ensure that it's configured correctly to forward requests to Kratos. Here's an example of how it might look: nginx location /auth { rewrite /auth/(.*) /$1 break; proxy_pass <http://127.0.0.1:4455;> proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }
This is based on the configuration example in the [Ory Kratos deployment guide](https://www.ory.sh/docs/kratos/guides/deploy-kratos-example#configure-user-interface). 3. Check for any overriding configurations: Make sure there are no other configuration settings or environment variables that might be overriding your ui_url
setting. 4. Verify the Ory Oathkeeper configuration: If you're using Ory Oathkeeper as an Identity and Access Proxy, ensure that it's configured correctly. The [Ory Kratos Zero Trust guide](https://www.ory.sh/docs/kratos/guides/zero-trust-iap-proxy-identity-access-proxy#running-ory-kratos-and-the-ory-oathkeeper-identity-and-access-proxy) provides information on how to set this up. If you've verified all these settings and the issue persists, it might be helpful to review your entire Kratos configuration and the setup of any reverse proxies or identity access proxies you're using. The unexpected redirection could be happening at a different layer of your infrastructure. Remember to restart your Kratos service after making any configuration changes for them to take effect.