Ory Kratos Identity Schema validation error mapping for accessible UI
0 reputation · 13 Jan 2023, 17:44 UTC
Self-Service Flow Error Handling
Ory Kratos employs a headless architecture where the Identity Schema defines validation rules for user-facing inputs. During self-service flows, such as registration or settings updates, the API returns validation errors when input constraints are violated.
Accessibility Constraints
To ensure compliance with accessibility standards (such as WCAG), the frontend must programmatically associate specific error messages with their corresponding input fields. While the API provides error details, the mapping between the JSON error response and the required ARIA attributes in a custom UI requires a consistent structural pattern.
Given the current state machine behavior in Kratos, there is uncertainty regarding the most efficient way to handle complex, multi-field validation errors without relying on generic API strings that may not be screen-reader friendly.
- How can the Identity Schema be configured to provide granular error identifiers that facilitate direct field-to-error mapping in the UI?
- Is there a recommended pattern for structuring the API response to support dynamic, accessible error associations in headless implementations?