//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
//
[[password-reset]]
==== Password Reset

When users lost their password, a feature is available to help gaining back access to Apache Syncope: password reset.

The process can be outlined as follows:

. user asks for password reset, typically via end-user
. user is asked to provide an answer to the security question that was selected during self-registration or self-update
. if the expected answer is provided, a unique token with time-constrained validity is internally generated and an
e-mail is sent to the configured address for the user with a link - again, typically to the
end-user - containing such token value
. user clicks on the received link and provides new password value, typically via end-user
. user receives confirmation via e-mail

[WARNING]
====
The outlined procedure requires a working <<e-mail-configuration,e-mail configuration>>.

In particular:

* the first e-mail is generated from the `requestPasswordReset` <<notification-templates, notification template>>:
hence, the token-based access link to the end-user is managed there;
* the second e-mail is generated from the `confirmPasswordReset` <<notification-templates, notification template>>.
====

[TIP]
====
The process above requires the availability of <<security-questions,security questions>> that
users can pick up and provide answers for.

The usage of security questions can be however disabled by setting the `passwordReset.securityQuestion` value - see
<<configuration-parameters, below>> for details.
====

[[password-reset-no-security-answer]]
[WARNING]
====
Once provided via Enduser Application, the answers to security questions are *never* reported, neither via REST or Admin UI to
administrators, nor to end-users via Enduser Application.

This to avoid any information disclosure which can potentially lead attackers to reset other users' passwords.
====

[NOTE]
In addition to the password reset feature, administrators can set a flag on a given user so that he / she is forced to
update their password value at next login.
