<@U04UQ68083H> why kratos want password confirmati...
# ory-copilot
f
@chilly-king-10285 why kratos want password confirmation for oidc apps with hydra is there a way to disable that? this is the example configuration that kratos gave password: enabled: false config: haveibeenpwned_host: "" haveibeenpwned_enabled: false max_breaches: 0 ignore_network_errors: false min_password_length: 6 identifier_similarity_check_enabled: false migrate_hook: enabled: false config: url: http://a.aaa method: POST headers: {} emit_analytics_event: false auth: type: api_key config: name: "" value: "" in: header
b
A message from kapa.ai
Ory Kratos may require password confirmation (re-authentication) for certain actions, even in OIDC app flows with Hydra, due to its security model around "privileged actions." For example, when a user tries to update sensitive information (like their password, email, or linked OIDC accounts), Kratos checks if the session is "privileged"—meaning the user has recently authenticated. If not, Kratos prompts for password confirmation to ensure the user is really present and authorized to perform the action. This is similar to "sudo mode" on platforms like GitHub and is controlled by the
privileged_session_max_age
setting in your configuration. If the session is older than this value, re-authentication is required, regardless of the authentication method used to log in (password, OIDC, etc.) [Settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings). Disabling password confirmation: If you want to avoid password confirmation prompts, you can set a high value for
privileged_session_max_age
in your Kratos config under the relevant flow (e.g., settings). For example:
Copy code
yaml selfservice:   flows:     settings:       privileged_session_max_age: 8760h # 1 year
Setting this to a very high value effectively disables frequent password confirmations. However, you cannot fully disable this security check without compromising security for privileged actions. Disabling password method entirely: If you set
password.enabled: false
in your config, users will not be able to use password-based authentication at all. This is only recommended if you exclusively use OIDC or other non-password methods for all users [Login and registration using passwords](https://www.ory.sh/docs/kratos/concepts/credentials/username-email-password). Summary: - Kratos asks for password confirmation for privileged actions to protect user accounts. - You can reduce or avoid these prompts by increasing
privileged_session_max_age
. - If you disable the password method, password prompts will not appear, but users cannot use passwords to log in or register. If you need more granular control or want to change this behavior for OIDC-only users, the knowledge sources do not provide a way to fully disable privileged session checks for OIDC flows only. This is a core part of Kratos' security model.
f
@chilly-king-10285 what if i put it 0
b
A message from kapa.ai
If you set
privileged_session_max_age: 0
in your Kratos configuration, it means that the session is never considered privileged after authentication. As a result, any action that requires a privileged session (such as updating sensitive settings or performing certain flows) will always require the user to re-authenticate, regardless of how recently they logged in. This effectively forces password (or other second-factor) confirmation every time a privileged action is attempted [Settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings) [Privileged sessions](https://www.ory.sh/docs/kratos/session-management/session-lifespan#privileged-sessions). This is the strictest security setting and is generally not recommended unless you have a specific use case that requires constant re-authentication for sensitive actions.
f
@chilly-king-10285 how to dont show this for me
b
Sorry @famous-jackal-2829, it looks like your question contains files, which I cannot process. Please reformulate your question without including any files.
f
@chilly-king-10285 may it comes handle somewhere with this example ? public: request_log: disable_for_health: false cors: enabled: false allowed_origins: - https://example.com - https://*.example.com - https://*.foo.example.com allowed_methods: - POST allowed_headers: - "" exposed_headers: - "" allow_credentials: false options_passthrough: false max_age: 0 debug: false
b
A message from kapa.ai
Based on the knowledge sources, the CORS (Cross-Origin Resource Sharing) configuration you provided under the
public
section is unrelated to the privileged session behavior or the requirement for password confirmation in Ory Kratos. The CORS settings control which origins, methods, and headers are allowed for cross-origin requests to the public API endpoints, but they do not affect session privilege checks or authentication flows [Cross-origin resource sharing (CORS) settings](https://www.ory.sh/docs/kratos/guides/setting-up-cors). The privileged session logic—such as how often a user is required to re-authenticate for sensitive actions—is handled by the
privileged_session_max_age
setting, not by CORS or request logging configuration [Privileged sessions](https://www.ory.sh/docs/kratos/session-management/session-lifespan#privileged-sessions). In summary: No, the CORS configuration you posted does not handle or influence the privileged session or password confirmation requirements in Ory Kratos.
f
@chilly-king-10285 what is the default valuee of this
privileged_session_max_age
b
A message from kapa.ai
The knowledge sources do not explicitly state the default value of
privileged_session_max_age
in Ory Kratos. The documentation provides examples of how to set this value (e.g.,
15m
for 15 minutes), but does not mention what the default is if you do not specify it in your configuration [Privileged sessions](https://www.ory.sh/docs/kratos/session-management/session-lifespan#privileged-sessions). If you need to know the exact default, you may need to check the official Ory Kratos source code or configuration reference, as the provided knowledge sources do not contain this information.