<@U04UQ68083H> how to setup password policies to r...
# ory-copilot
f
@chilly-king-10285 how to setup password policies to require certain special characters. e.g. via a regular expression?
c
A message from kapa.ai
I'm sorry, but the information provided in the knowledge sources does not include specific instructions on how to set up password policies to require certain special characters via a regular expression in Ory. However, Ory does follow the NIST Digital Identity Guidelines, which recommend allowing all characters (unicode, ASCII) in passwords and not imposing composition rules such as requiring mixtures of different character types. For more information on Ory's password policy, you can refer to the [Ory Password Policy Documentation](https://www.ory.sh/docs/concepts/password-policy).
f
@chilly-king-10285 ok, and what is the option
max_breaches
?
c
A message from kapa.ai
I'm sorry, but the information provided in the knowledge sources does not include specific details about an option called
max_breaches
in Ory. It would be best to refer to the official Ory documentation or reach out to Ory support for more accurate information.
f
@chilly-king-10285 can I enforce such specific rules like requiring specific special characters via a webhook action?
c
A message from kapa.ai
Yes, you can use Ory Actions and webhooks to enforce specific rules, such as requiring certain special characters in a password. While the knowledge sources do not provide a specific example for this use case, they do explain how to use Ory Actions and webhooks to add additional validation and control over user flows. For example, you can create a webhook that triggers an external service to validate the password according to your specific rules when a user attempts to register or update their password. If the password does not meet your criteria, the external service can return an HTTP response code in the
4xx
or
5xx
range to interrupt the flow and prevent the user from completing the action. Here is an example of how you might configure a webhook to parse the response and potentially interrupt the flow:
Copy code
yaml hook: web_hook   config:     response:       parse: true
And here is an example of a payload that the external service might return to indicate a validation error:
Copy code
json {     "messages": [       {         "instance_ptr": "#/traits/password",        "messages": [           {             "id": 123,            "text": "Password must contain a special character.",             "type": "validation",             "context": {               "value": "invalid password"             }           }         ]       }     ]   }
Please note that this is a general example and the actual implementation may vary depending on your specific requirements and the capabilities of the external service. For more information on how to use Ory Actions and webhooks, you can refer to the following documentation: - [Actions triggered before events](https://www.ory.sh/docs/kratos/hooks/configure-hooks#actions-triggered-before-events) - [Available actions](https://www.ory.sh/docs/kratos/hooks/configure-hooks#available-actions) - [Trigger custom logic and integrate with external systems with webhooks](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks) - [Flow-interrupting webhooks](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#flow-interrupting-webhooks)