dazzling-dinner-37229
03/20/2025, 5:08 AMory patch identity-config --project 1025b967-2cee-48ba-a59b-75971a1e90b9 --add '/selfservice/flows/login/after/password/hooks=[{"hook": "verification"}]'
ory patch identity-config --project 1025b967-2cee-48ba-a59b-75971a1e90b9 --add '/selfservice/flows/login/after/password/hooks=[{"hook": "show_verification_ui"}]'
When ever these patch command is executed the settings for (Authentication > Account verification) Require verified address for login
also get’s disabled.
However, verification ui after registration does work. If it re-enable require verification address for login
user is prompted with a message that their account is not verified but they are not redirected to verification ui.
Identity Schema has { verification: { via: "email" }
set. Shouldn’t this work similar to how verification ui works after registration
Looks like there is a bug with verification ui after login flowbrief-egg-61061
03/20/2025, 5:08 AMbrief-egg-61061
03/20/2025, 5:09 AMrequire_verified_address
hook. 2. Show verification UI after login - This feature allows users to log in but then shows them the verification UI. It uses the verification
and show_verification_ui
hooks. These two approaches are somewhat contradictory - one prevents login until verification, while the other allows login but then prompts for verification. ## Possible Solutions Based on the knowledge sources, here are some approaches: 1. Choose one approach: Either require verification before login OR allow login and then show verification UI. 2. For SPA clients: The documentation mentions that for SPA clients, the response contains a continue_with
field with verification flow information: json { "continue_with": [ { "action": "show_verification_ui", "flow": { "id": "d859f6af-1dfe-453e-9320-d572e10edeea", "verifiable_address": "<mailto:email@example.com|email@example.com>" } } ] }
You should check for this field in your API responses and handle it accordingly in your custom UI. 3. Check for OAuth flow issues: There appears to be a known issue with verification flows in OAuth contexts as mentioned in [SPA flows do not continue with OAuth flow after registration](https://github.com/ory/network/issues/352). ## Recommendation Since you mentioned your verification UI works after registration but not after login, I recommend: 1. Check if you're properly handling the continue_with
field in your API responses 2. Consider using only the verification
hook without the require_verified_address
hook if you want to allow login but then show verification 3. If you're using OAuth flows, be aware of potential issues with verification redirects If you continue to experience issues, this might be related to the bug mentioned in [Phone+email schema: verification email is sent when signed up with SMS code](https://github.com/ory/kratos/issues/4161) where a commenter noted that enabling of verification hooks appears to be hardcoded in certain flows. I hope this helps clarify the issue. Let me know if you need further assistance!dazzling-dinner-37229
03/24/2025, 7:06 AMdazzling-dinner-37229
03/24/2025, 7:08 AMbrief-egg-61061
03/24/2025, 7:08 AMbrief-egg-61061
03/24/2025, 7:08 AMcontinue_with
field in API responses. ## Email Verification for OIDC Identities There appears to be a known issue with OIDC identities and email verification. According to a GitHub issue: > "When Require Verified Address for Login
is activated, OIDC identities can still login, even if they have not verified their email address yet." This happens because "the verified status is not carried over from the oidc provider. So basically every user is unverified when using social sign in in kratos." [Github Issue #246](https://github.com/ory/network/issues/246) ## Getting continue_with
Field for Verification For OIDC logins, you need to add the verification hooks specifically for the OIDC method: ory patch identity-config {project_id} \ --add '/selfservice/flows/login/after/oidc/hooks=[{"hook": "verification"}]' \ --add '/selfservice/flows/login/after/oidc/hooks=[{"hook": "show_verification_ui"}]'
The continue_with
field containing verification information should appear in the API response after: 1. A successful login via OIDC where the user's email is not verified 2. When the proper hooks are configured for the OIDC method The response would look like this: json { "continue_with": [ { "action": "show_verification_ui", "flow": { "id": "d859f6af-1dfe-453e-9320-d572e10edeea", "verifiable_address": "<mailto:email@example.com|email@example.com>", "url": "/ui/verification?flow=d859f6af-1dfe-453e-9320-d572e10edeea" } } ] }
You can then use this information to redirect the user to the verification UI or fetch the verification flow using the [getVerificationFlow
](https://www.ory.sh/docs/reference/api#tag/frontend/operation/getVerificationFlow) API method. Note that according to the documentation, "The response from the registration endpoint always contains the continue_with
field with the verification_ui
action, if verification is enabled and the identity schema defines at least one verifiable address." [Ory Docs: Show verification after login](https://www.ory.sh/docs/identities/sign-in/actions#show-verification-after-login-if-address-is-not-verified-yet) However, there might be console/UI issues with setting these hooks as mentioned in the GitHub issue: "the frontend only sets the hook for the password method. It doesn't for OIDC & Webauthn. So this is just a console issue." [Github Issue #246](https://github.com/ory/network/issues/246)dazzling-dinner-37229
03/24/2025, 7:17 AMbrief-egg-61061
03/24/2025, 7:17 AMbrief-egg-61061
03/24/2025, 7:18 AMshow_verification_ui
hook not working properly for OIDC registration flows. This is related to several documented issues in the Ory GitHub repositories. ## Why Your Configuration Doesn't Work The issue you're experiencing with OIDC registration verification is likely related to a known problem where verification hooks don't work properly in OAuth/OIDC flows. According to [GitHub issue #320](https://github.com/ory/network/issues/320): > "Within an OAuth flow within the AX the user is not shown the verification UI when the show_verification_ui
hook is enabled. Instead it redirects back to the OAuth client." This issue specifically mentions that when using OAuth flows, the verification UI doesn't appear after registration even when the show_verification_ui
hook is configured. ## Hook Ordering Issues Another potential issue could be related to hook ordering. As mentioned in [GitHub issue #361](https://github.com/ory/network/issues/361), the session
hook can override other hooks if it's placed before them: > "The session hook overwrites any other hooks that run after it which is why you don't see a response." Your current configuration has: yaml oidc: hooks: - hook: show_verification_ui - hook: session
While this ordering looks correct (verification before session), there might be other issues at play. ## OAuth Flow Continuation There's also a specific issue with OAuth flows not continuing properly after registration and verification, as documented in [GitHub issue #352](https://github.com/ory/network/issues/352): > "SPA flows do not continue with OAuth flow after registration" This issue notes that after registration and verification, the OAuth flow doesn't continue as expected. ## Recommendations 1. Try using the verification
hook instead of or in addition to `show_verification_ui`: yaml oidc: hooks: - hook: verification - hook: show_verification_ui - hook: session
2. For SPA and native clients, check for the continue_with
field in the API response, which should contain verification flow information regardless of the show_verification_ui
hook: json { "continue_with": [ { "action": "show_verification_ui", "flow": { "id": "d859f6af-1dfe-453e-9320-d572e10edeea", "verifiable_address": "<mailto:email@example.com|email@example.com>" } } ] }
3. If you're using OAuth flows, be aware that there are known issues with verification redirects in this context that might require workarounds or waiting for fixes from the Ory team. If these suggestions don't resolve your issue, it might be a bug that needs to be reported to the Ory team.dazzling-dinner-37229
03/24/2025, 11:44 AMbrief-egg-61061
03/24/2025, 11:44 AMbrief-egg-61061
03/24/2025, 11:44 AMUnable to validate config: I[#/selfservice/flows/registration/after/hooks/1/hook] S[#/definitions/b2bSSOHook/properties/hook/const] value must be "b2b_sso"
This suggests that you're trying to add a hook at position 1 in the registration flow's "after" hooks array, but the system is expecting a specific hook type ("b2b_sso") at that position. ## Possible Causes From the knowledge sources, there are several known issues with hook configurations: 1. Hook Ordering Issues: As mentioned in [Troubleshoot Ory Actions Webhook issues](https://www.ory.sh/docs/troubleshooting/troubleshoot-actions), the order of hooks matters, especially with the session
hook which can override other hooks. 2. Method-Specific Hooks: According to [Trigger precedence](https://www.ory.sh/docs/kratos/hooks/configure-hooks#trigger-precedence), when an authentication method specifies actions, it overrides the default actions for the flow. 3. Invalid Hook Configuration: Some hooks may have specific requirements or may not be compatible with certain flows or methods. ## Solutions Here are some approaches to resolve this issue: 1. Check Your Hook Configuration: Make sure you're using a valid hook type. The error suggests you need to use "b2b_sso" for that specific position. 2. Use Method-Specific Hooks: Instead of adding hooks to the general "after" section, try adding them to specific methods: yaml registration: after: password: hooks: - hook: show_verification_ui - hook: session oidc: hooks: - hook: show_verification_ui - hook: session
3. Use the CLI for Complex Configurations: As mentioned in [GitHub issue #361](https://github.com/ory/network/issues/361), sometimes it's better to use the Ory CLI for editing registration hooks instead of the UI: ory patch identity-config --project <project-id> --replace '/selfservice/flows/registration/after/password/hooks=[{"hook": "show_verification_ui"}, {"hook": "session"}]'
4. Check for Additional Properties: Some hooks don't allow additional properties. For example, in [GitHub issue #328](https://github.com/ory/network/issues/328), there was an error: "additionalProperties \"config\" not allowed" for the show_verification_ui hook. If you continue to experience issues, please share your complete hook configuration so I can provide more specific guidance. Remember that the session
hook should typically be the last one in the sequence, as it modifies the HTTP response and no other hooks are executed after it. Would you like me to provide more specific guidance on configuring a particular type of hook?dazzling-dinner-37229
03/28/2025, 3:29 AMbrief-egg-61061
03/28/2025, 3:29 AMbrief-egg-61061
03/28/2025, 3:29 AMdazzling-dinner-37229
03/28/2025, 3:55 AMbrief-egg-61061
03/28/2025, 3:55 AMbrief-egg-61061
03/28/2025, 3:55 AMsession
hook 5. The show_verification_ui
hook may not work as expected with OIDC flows For the most reliable solution, I recommend: 1. Reviewing your Jsonnet configuration for proper data mapping as described in [Troubleshooting Social Sign-in](https://www.ory.sh/docs/troubleshooting/troubleshooting-social-sign-in) 2. Simplifying your Identity Schema temporarily to isolate the issue 3. Using the Ory CLI for hook configuration rather than the UI 4. Checking for any required traits in your schema that might not be provided by your OIDC provider If you need any further assistance with specific aspects of your Ory implementation, please let me know!dazzling-dinner-37229
03/28/2025, 3:56 AMshow_verification_ui
hook may not work as expected with OIDC flows
why is that?brief-egg-61061
03/28/2025, 3:56 AMbrief-egg-61061
03/28/2025, 3:57 AMshow_verification_ui
hook may not work as expected with OIDC flows: 1. OAuth Flow Continuation Issue: According to [GitHub issue #320](https://github.com/ory/network/issues/320), there's a known bug where "Within an OAuth flow within the AX the user is not shown the verification UI when the show_verification_ui
hook is enabled. Instead it redirects back to the OAuth client." This is a fundamental issue with how verification flows work in OAuth contexts. 2. Verification Status Not Carried Over: As mentioned in [GitHub issue #246](https://github.com/ory/network/issues/246), "the verified status is not carried over from the oidc provider. So basically every user is unverified when using social sign in in kratos." This means that even if a user's email is verified at the OIDC provider, Kratos doesn't recognize this verification status. 3. Console/UI Configuration Limitations: The same issue notes that "the frontend only sets the hook for the password method. It doesn't for OIDC & Webauthn. So this is just a console issue." This suggests there are UI limitations in configuring these hooks properly for OIDC methods. 4. Code Implementation Issue: In [GitHub issue #320](https://github.com/ory/network/issues/320), a commenter noted: "in ory/kratos we don't continue to the verification flow when there is a login_challenge in the URL as shown here https://github.com/ory/kratos/blob/master/selfservice/flow/registration/hook.go#L249-L258". This indicates there's a specific code implementation that prevents verification flows from continuing when an OAuth login challenge is present. 5. Return URL Handling: The issue also mentions that "We probably need to continue to the verification flow with a return_to
parameter of the current login URL." This suggests that the verification flow doesn't properly handle return URLs in OAuth contexts. These issues collectively explain why the show_verification_ui
hook doesn't work as expected with OIDC flows. The Ory team appears to be aware of these issues and has been working on fixes, but they represent fundamental challenges in integrating verification flows with OAuth/OIDC authentication patterns. I hope this clarifies why you're experiencing issues with verification UI in OIDC flows!dazzling-dinner-37229
03/28/2025, 4:19 AMbrief-egg-61061
03/28/2025, 4:19 AMbrief-egg-61061
03/28/2025, 4:19 AMshow_verification_ui
hook is enabled. Instead it redirects back to the OAuth client." 2. [Require verified address doesn't work for OIDC identities](https://github.com/ory/network/issues/246) - This related issue mentions: "the frontend only sets the hook for the password method. It doesn't for OIDC & Webauthn. So this is just a console issue." The first issue (#320) is the most relevant to your question as it specifically describes the problem where verification UI doesn't appear after OIDC flows even when the appropriate hooks are configured.dazzling-dinner-37229
03/28/2025, 4:32 AMshow_verification_ui
and verification
ory patch identity-config {project_id} \
--add '/selfservice/flows/registration/after/password/hooks=[{"hook": "show_verification_ui"}]' \
--add '/selfservice/flows/registration/after/oidc/hooks=[{"hook": "show_verification_ui"}]' \
--add '/selfservice/flows/registration/after/webauthn/hooks=[{"hook": "show_verification_ui"}]'
and
ory patch identity-config {project_id} \
--add '/selfservice/flows/login/after/password/hooks=[{"hook": "verification"}]' \
--add '/selfservice/flows/login/after/oidc/hooks=[{"hook": "verification"}]' \
--add '/selfservice/flows/login/after/webauthn/hooks=[{"hook": "verification"}]'brief-egg-61061
03/28/2025, 4:32 AMbrief-egg-61061
03/28/2025, 4:32 AMshow_verification_ui
and verification
hooks in Ory Identities: ## verification
hook The verification
hook is used to trigger the verification process for unverified addresses. When applied to login flows, it checks if the user has any unverified addresses and initiates the verification process for them. This hook doesn't automatically redirect the user to the verification UI - it just prepares the verification flow. ## show_verification_ui
hook The show_verification_ui
hook is specifically designed to redirect the user to the verification UI after a successful registration or login. For browser-based flows, it automatically redirects the user to the verification screen. This hook is responsible for the actual redirection to the verification interface. ## Key differences 1. Purpose: - `verification`: Initiates the verification process - `show_verification_ui`: Redirects to the verification UI 2. Behavior: - `verification`: Creates a verification flow but doesn't redirect - `show_verification_ui`: Creates a verification flow AND redirects (in browser flows) 3. Usage context: - The first command in your question adds show_verification_ui
to registration flows, which will redirect users to verify their email immediately after registration - The second command adds verification
to login flows, which will initiate verification for unverified addresses after login, but won't automatically redirect ## Best practice For browser-based applications, if you want users to be redirected to the verification UI after login when they have unverified addresses, you should use both hooks: ory patch identity-config {project_id} \ --add '/selfservice/flows/login/after/password/hooks=[{"hook": "verification"}, {"hook": "show_verification_ui"}]' \ --add '/selfservice/flows/login/after/oidc/hooks=[{"hook": "verification"}, {"hook": "show_verification_ui"}]' \ --add '/selfservice/flows/login/after/webauthn/hooks=[{"hook": "verification"}, {"hook": "show_verification_ui"}]'
This is mentioned in the documentation [Show verification after login if address is not verified yet](https://www.ory.sh/docs/identities/sign-in/actions#show-verification-after-login-if-address-is-not-verified-yet). Remember that as we discussed earlier, there are known issues with these hooks in OIDC flows that might prevent the verification UI from showing properly.dazzling-dinner-37229
03/28/2025, 4:34 AMbrief-egg-61061
03/28/2025, 4:34 AMbrief-egg-61061
03/28/2025, 4:34 AMverified_addresses
field in your Jsonnet mapping: jsonnet { identity: { traits: { // Your traits mapping }, verified_addresses: std.prune([ if 'email' in claims && claims.email_verified then { via: 'email', value: claims.email }, ]), } }
This approach automatically marks emails as verified if the OIDC provider confirms they're verified [GitHub Kratos Discussion #3936](https://github.com/ory/kratos/discussions/3936). 2. Known Issues with Verification UI in OIDC Flows As we discussed earlier, there's a documented issue where "Within an OAuth flow within the AX the user is not shown the verification UI when the show_verification_ui
hook is enabled. Instead it redirects back to the OAuth client" [GitHub Issue #320](https://github.com/ory/network/issues/320). 3. Configuration for OIDC Verification For OIDC flows, you need both hooks: ory patch identity-config {project_id} \ --add '/selfservice/flows/login/after/oidc/hooks=[{"hook": "verification"}, {"hook": "show_verification_ui"}]'
However, due to the issues mentioned above, this might not work as expected. ## Workarounds for OIDC Email Verification 1. Handle continue_with
in API Responses For SPA and native clients, check for the continue_with
field in API responses and manually redirect users to the verification UI: json { "continue_with": [ { "action": "show_verification_ui", "flow": { "id": "d859f6af-1dfe-453e-9320-d572e10edeea", "verifiable_address": "<mailto:email@example.com|email@example.com>" } } ] }
2. Use the Verified Status from OIDC Provider The most reliable approach is to properly configure your Jsonnet mapping to carry over the verified status from the OIDC provider as shown above. 3. Custom Verification Logic If the built-in hooks don't work for your use case, you might need to implement custom verification logic using Ory Actions or webhooks. Remember that there are ongoing issues with verification flows in OIDC contexts, so you might need to implement custom handling in your application until these issues are resolved in Ory.dazzling-dinner-37229
04/09/2025, 2:08 AMbrief-egg-61061
04/09/2025, 2:08 AMbrief-egg-61061
04/09/2025, 2:09 AMcurl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/verification/browser|PROJECT_SLUG.projects.oryapis.com/self-service/verification/browser>
2. Then submit the initial verification request with the email: curl -X POST \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{"method":"code","email":"<mailto:user@example.com|user@example.com>","csrf_token":"your-csrf-token"}' \ "https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/verification?flow=<your-flow-id|PROJECT_SLUG.projects.oryapis.com/self-service/verification?flow=<your-flow-id>>"
3. After receiving the code via email, submit the verification code: curl -X POST \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{"method":"code","code":"123456","csrf_token":"your-csrf-token"}' \ "https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/verification?flow=<your-flow-id|PROJECT_SLUG.projects.oryapis.com/self-service/verification?flow=<your-flow-id>>"
## Key Points to Note 1. Required Fields: According to the [API documentation](https://www.ory.sh/docs/reference/api), the required fields for code verification are: - `method`: Must be "code" - `code`: The verification code (when submitting the code) - `csrf_token`: Required for browser flows 2. Do NOT include both email
and code
: When submitting the code, make sure to not include the email field. As the API docs state: "If you want to submit a code, use this field, but make sure to not include the email field, as well." 3. Identifier vs Email: The API documentation doesn't mention an identifier
field for verification flows. You should use email
instead. 4. Flow Parameter: The flow ID should be included as a query parameter, not in the request body. ## Example of Correct Request Body For the initial request: json { "method": "code", "email": "<mailto:user@example.com|user@example.com>", "csrf_token": "your-csrf-token" }
For submitting the code: json { "method": "code", "code": "123456", "csrf_token": "your-csrf-token" }
If you continue to experience issues, check that your identity schema has properly configured the email field for verification with "verification": { "via": "email" }
.dazzling-dinner-37229
04/09/2025, 2:10 AMbrief-egg-61061
04/09/2025, 2:10 AMbrief-egg-61061
04/09/2025, 2:10 AMgo package main import ( "context" "fmt" "os" "<http://github.com/ory/client-go|github.com/ory/client-go>" ) func main() { // Initialize the Ory client cfg := client.NewConfiguration() cfg.Servers = client.ServerConfigurations{ {URL: fmt.Sprintf("<https://%s.projects.oryapis.com>", os.Getenv("ORY_PROJECT_SLUG"))}, } ory := client.NewAPIClient(cfg) ctx := context.Background() // Step 1: Create a verification flow flow, _, err := ory.FrontendApi.CreateNativeVerificationFlow(ctx).Execute() if err != nil { fmt.Printf("Error creating verification flow: %v\n", err) return } flowID := flow.GetId() fmt.Printf("Created verification flow with ID: %s\n", flowID) // Step 2: Submit the email to receive a verification code emailBody := *client.NewUpdateVerificationFlowWithCodeMethodAsUpdateVerificationFlowBody("code") emailBody.SetEmail("<mailto:user@example.com|user@example.com>") updatedFlow, _, err := ory.FrontendApi.UpdateVerificationFlow(ctx). Flow(flowID). UpdateVerificationFlowBody(emailBody). Execute() if err != nil { fmt.Printf("Error submitting email for verification: %v\n", err) return } fmt.Println("Verification code sent to email. Check your inbox.") // Step 3: Submit the verification code (after user receives it) // Note: This would typically be in a separate request after the user gets the code codeBody := *client.NewUpdateVerificationFlowWithCodeMethodAsUpdateVerificationFlowBody("code") codeBody.SetCode("123456") // Replace with the actual code from the email verifiedFlow, _, err := ory.FrontendApi.UpdateVerificationFlow(ctx). Flow(flowID). UpdateVerificationFlowBody(codeBody). Execute() if err != nil { fmt.Printf("Error submitting verification code: %v\n", err) return } fmt.Println("Email verification successful!") }
### TypeScript SDK typescript import { Configuration, FrontendApi, UpdateVerificationFlowWithCodeMethod } from "@ory/client" async function verifyEmail() { // Initialize the Ory client const ory = new FrontendApi( new Configuration({ basePath: `https://${process.env.ORY_PROJECT_SLUG}.<http://projects.oryapis.com|projects.oryapis.com>`, }), ) try { // Step 1: Create a verification flow const { data: flow } = await ory.createNativeVerificationFlow() console.log(`Created verification flow with ID: ${flow.id}`) // Step 2: Submit the email to receive a verification code const { data: updatedFlow } = await ory.updateVerificationFlow({ flow: flow.id, updateVerificationFlowBody: { method: "code", email: "<mailto:user@example.com|user@example.com>" } as UpdateVerificationFlowWithCodeMethod }) console.log("Verification code sent to email. Check your inbox.") // Step 3: Submit the verification code (after user receives it) // Note: This would typically be in a separate request after the user gets the code const { data: verifiedFlow } = await ory.updateVerificationFlow({ flow: flow.id, updateVerificationFlowBody: { method: "code", code: "123456" // Replace with the actual code from the email } as UpdateVerificationFlowWithCodeMethod }) console.log("Email verification successful!") } catch (error) { console.error("Error during verification process:", error) } } verifyEmail()
These examples follow the verification flow process as documented in [Ory's Bring-your-own-UI Integration Basics](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#verification-flow): 1. Create a verification flow 2. Submit the email to receive a verification code 3. Submit the verification code after the user receives it Note that in a real application, steps 2 and 3 would typically be separate operations, with step 3 occurring after the user receives and enters the code. Is there a specific programming language or framework you'd like me to provide an example for?dazzling-dinner-37229
04/09/2025, 9:42 AMbrief-egg-61061
04/09/2025, 9:42 AMbrief-egg-61061
04/09/2025, 9:43 AMhook: web_hook config: url: <https://your-service.example.com/check-verification> method: POST response: ignore: false parse: true auth: type: api_key config: # Your auth configuration
Your webhook endpoint would need to return a response that either: 1. Allows the flow to continue if the email is verified 2. Redirects to the verification page if the email is not verified ## Alternative Approach If you prefer not to use external webhooks, you can also use Ory's built-in hooks: 1. Add the verification
hook to check if verification is needed 2. Add the show_verification_ui
hook to redirect to the verification UI ory patch identity-config {project_id} \ --add '/selfservice/flows/login/after/password/hooks=[{"hook": "verification"}, {"hook": "show_verification_ui"}]'
However, as we discussed earlier, there are known issues with these hooks in OIDC flows. [Ory Actions with webhooks](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks) provide the most flexible approach for implementing custom verification logic before issuing a session.dazzling-dinner-37229
04/09/2025, 9:53 AMbrief-egg-61061
04/09/2025, 9:53 AMbrief-egg-61061
04/09/2025, 9:54 AMshow_verification_ui
hook redirects them to the verification UI 2. This is a browser redirect, not a forced state change 3. The user can navigate away from this page using browser controls ## Possible Solutions 1. Use the session
hook with verification requirements: Configure your system to require verified emails for subsequent logins. This way, even if users skip verification initially, they'll be forced to verify before their next login. 2. Implement a custom UI: As mentioned in the GitHub issue, a custom UI would give you more control over the verification flow and could prevent users from bypassing it. 3. Use flow-interrupting webhooks: You could implement a webhook that checks verification status and prevents access to protected resources until verification is complete. 4. Require verified address for login: Enable the "Require Verified Address for Login" setting in the Ory Console under Authentication → Email verification. This ensures users must verify their email before they can log in again. ## Best Practice Recommendation The most robust approach is a combination of: 1. Enabling "Require Verified Address for Login" 2. Adding the session
hook after registration to allow one-time access 3. Using webhooks to limit functionality for unverified users This way, users can access your application immediately after registration (improving UX), but they'll need to verify their email to maintain access and use all features. Would you like more specific guidance on implementing any of these solutions?dazzling-dinner-37229
04/10/2025, 4:33 AMbrief-egg-61061
04/10/2025, 4:33 AMbrief-egg-61061
04/10/2025, 4:33 AMyaml selfservice: flows: settings: required_aal: highest_available session: whoami: required_aal: aal1
This configuration forces users to use their highest available authentication factor but doesn't prevent linking multiple methods. ### 3. Use Flow-Interrupting Webhooks You can implement a custom webhook that prevents users from linking additional authentication methods: 1. Create a flow-interrupting webhook for the settings flow 2. In your webhook logic, check if the user is attempting to add a new authentication method 3. If they already have one method, return an error response ### 4. Modify the UI If you're using a custom UI, you can simply not display the options for linking additional authentication methods in your settings page. ## Important Considerations 1. Security Implications: Restricting users to a single authentication method can create account recovery challenges if that method becomes unavailable. 2. Account Recovery: If you disable multiple login methods, ensure you have a robust account recovery process in place. 3. User Experience: Consider how this restriction might impact user experience, especially for users who prefer different authentication methods in different contexts. Would you like more specific guidance on implementing any of these approaches?dazzling-dinner-37229
04/10/2025, 4:43 AMbrief-egg-61061
04/10/2025, 4:43 AMbrief-egg-61061
04/10/2025, 4:43 AM