Allow custom URI schemes for CORS allowed origins
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- ios
- Área
- api, mobile-dev, security
Línea de trabajo
Start by tracing validation and matching for cors_allowed_origins on custom domains, then compare it with the redirect URL handling implemented for issue #331. Done means custom URI schemes such as capacitor:// are accepted with exact matching, while existing http and https behavior remains unchanged; verify the preflight behavior and relevant validation tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
https://thirsty-wozniak-lyfkkuj3wq.projects.oryapis.com
Describe your problem
The CORS allowed-origins validator on a custom domain accepts http and https only. Any other scheme is rejected with:
'capacitor://app.example.com' is not a valid CORS origin. Use '<scheme>://<hostname>:<port>'.
The message points at the format, but the format is not the issue — the scheme is. Tested on our project, on Branding → Custom domains → Allowed origins:
| origin | result |
|---|---|
https://app.example.com |
accepted |
http://app.example.com |
accepted |
capacitor://app.example.com |
rejected |
capacitor://app.example.com:443 |
rejected, same message — so it is not about the port |
myscheme://app.example.com |
rejected — so it is not about capacitor specifically |
This locks out hybrid mobile apps on iOS.
A Capacitor/Ionic app serves its bundled WebView from a custom scheme, and that is the Origin the WebView sends: capacitor://localhost by default, or capacitor://<your-hostname> once server.hostname is configured. Since that origin cannot be allow-listed, a plain fetch() from the app to Ory is impossible on iOS (the preflight is never granted).
The scheme is not negotiable on our side either. Capacitor's iosScheme cannot be set to http or https, because WebKit raises on it.
So there is no scheme that satisfies both Ory and iOS.
Android is unaffected :androidScheme defaults to https, and after adding https://<our-host> to the custom domain's allowed origins, the full flow works (preflight 204 with access-control-allow-headers: authorization, then GET /sessions/whoami returning 200 with the tokenized session). Only iOS is stuck.
Describe your ideal solution
Allow custom URI schemes in cors_allowed_origins on custom domains, with exact matching only (no wildcard support needed for them).
There is a direct precedent: #331 raised the same limitation for redirect URLs and was implemented. The same reasoning applies here, for the same class of application.
Workarounds or alternatives
-
Bypass the browser with a native HTTP plugin. This is what Capacitor's own documentation recommends when CORS blocks you, and it is what we do today. It works, but it moves the request out of the WebView's network stack and into the platform's raw HTTP client, losing Happy Eyeballs, the browser's DNS resolver, connection pooling and coalescing.
-
Run a backend proxy that forwards to Ory server-side, so the app talks to an origin we control. This works, and it is our fallback, but it means standing up and maintaining a service whose only purpose is to relay auth calls (which rather defeats the point of a managed identity provider).
Version
Ory Network (managed), as of 2026-09-30
Additional Context
No response
- Lenguaje dominante
- Shell
- Estrellas
- 96
- Forks
- 8
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ory/network
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
-
Updating native registration flow with OIDC ID token for existing identity returns breaking responseAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Ory Account Experience (hosted UI) registration trait setup via creation of registration flowAbiertofeat
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
selfservice.flows.login.style reverts to identifier_first despite explicitly setting passwordAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
-
feat
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Todos los issues de ory/network
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
unixorn/awesome-zsh-plugins#2285 ·
Los mantenedores suelen responder en 1 día
-
documentation priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
snapotter-hq/SnapOtter#1863 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
nasa-jpl/bespokebpv7#51 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
area/rules
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
usnistgov/macos_security#836 ·
Los mantenedores suelen responder en 1 día