billions-minister-2901
02/23/2024, 4:56 PMchilly-king-10285
02/23/2024, 4:56 PMchilly-king-10285
02/23/2024, 4:56 PMAccess-Control-Allow-Origin
header is only set on domains they own. You can configure custom domains to use specific CORS settings. For CORS to work properly, you should set the following values in your configuration: yaml serve: admin: cors: enabled: true allowed_origins: - <https://example.com> - https://*.<http://example.com|example.com> allowed_methods: - POST - GET - PUT - PATCH - DELETE allowed_headers: - Authorization exposed_headers: - Content-Type public: cors: enabled: true allowed_origins: - <https://example.com> - https://*.<http://example.com|example.com> allowed_methods: - POST - GET - PUT - PATCH - DELETE allowed_headers: - Authorization exposed_headers: - Content-Type
Remember to replace <https://example.com>
and https://*.<http://example.com|example.com>
with your own domain. If you're building Single-Page Apps (SPAs) and you want the application to access the Ory Identities Public API, you need to configure your AJAX request to include cookies, because AJAX doesn't send cookies by default. For example, when using the browser's fetch
function, you need to set credentials: 'include'
. For more information, you can refer to the following sources: - [Ory Documentation on CORS](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#cors-errors) - [Ory Documentation on Custom Domains](https://www.ory.sh/docs/guides/custom-domains) - [Ory Documentation on Troubleshooting CSRF](https://www.ory.sh/docs/troubleshooting/csrf#accessing-apis-from-client-side-javascript--ajax) - [Ory Documentation on Setting up CORS](https://www.ory.sh/docs/guides/cors) - [Mozilla Documentation on CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)billions-minister-2901
02/23/2024, 5:09 PMchilly-king-10285
02/23/2024, 5:09 PMchilly-king-10285
02/23/2024, 5:10 PM/registration
endpoint, it could be due to a number of reasons. Here are a few things you can check: 1. CORS Configuration: Ensure that your CORS settings are correctly configured for your custom domain. Ory has a "deny by default" policy, which means that the Access-Control-Allow-Origin
header is only set on domains they own. You need to add your custom domain to the Ory Project so that all requests from your frontend can be made to Ory under the same domain. 2. Domain Propagation: After adding the domain in the Ory Console, it can take up to 24 hours for your changes to propagate. Ory will continuously recheck its status to see if it was configured with your registrar. You can manually recheck on the custom domains page, or check the value to set with your DNS provider. 3. Active Status: When the domain is reachable, it will have the "Active status". The CORS status will show "Inactive" while the domain is pending verification. After the domain is verified, the CORS status will show "Enabled/Disabled". 4. AJAX Requests: If you're building Single-Page Apps (SPAs) and you want the application to access the Ory Identities Public API, you need to configure your AJAX request to include cookies, because AJAX doesn't send cookies by default. For example, when using the browser's fetch
function, you need to set credentials: 'include'
. For more detailed information, you can refer to the following sources: - [Ory Documentation on CORS](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#cors-errors) - [Ory Documentation on Custom Domains](https://www.ory.sh/docs/guides/custom-domains) - [Ory Documentation on Troubleshooting CSRF](https://www.ory.sh/docs/troubleshooting/csrf#accessing-apis-from-client-side-javascript--ajax) - [Ory Documentation on Setting up CORS](https://www.ory.sh/docs/guides/cors) - [Mozilla Documentation on CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)