Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement User Account Recovery V2 API #16536

Closed
Rashmini opened this issue Aug 28, 2023 · 4 comments
Closed

Implement User Account Recovery V2 API #16536

Rashmini opened this issue Aug 28, 2023 · 4 comments

Comments

@Rashmini
Copy link
Contributor

Rashmini commented Aug 28, 2023

Is your suggestion related to an experience ? Please describe.
We have encountered following issues with the current recovery V1 API [1] we have.

  • When the user submits an OTP in the recovery flow, the OTP itself is used to correlate the user, which is not a correct behaviour.
  • The resend code can be used and refreshed indefinitely to keep resending OTPs to the user/ flooding the OTP services.

Considering the above, we need to provide a new V2 API based on the following approach,

  • There will be a unique identifier(UUID) for a particular password recovery attempt which is bound to a particular user.
  • This identifier will be generated at the recovery flow initiation, and it will not be changed in the rest of the flow.
  • The generated OTP will be bound to the above unique identifier.
  • When the password is reset, the API call should include the above UUID, OTP and the new password.
  • Validation happens for the submitted OTP against the recovery context data retrieved from the UUID in the request.
  • To mitigate possible brute force attacks, the UUID will be invalidated when a certain number of failed OTP validations is exceeded.

UI support for the User Account Recovery V2 API will be onboarded at a later phase.

[1] https://is.docs.wso2.com/en/latest/guides/identity-lifecycles/extend-username-and-password-recovery/#with-internal-notification-management

@Rashmini
Copy link
Contributor Author

Rashmini commented Aug 28, 2023

We have decided to disable the current recovery service along with this improvement. A config is introduced to enable/disable the service.

Related PRs:

The following config should be added to the deployment.toml file to enable the service.

[identity_mgt.recovery]
enable_v1_api = true

@Rashmini
Copy link
Contributor Author

Rashmini commented Sep 4, 2023

DB migration is tracked with #16576

@Rashmini
Copy link
Contributor Author

There's an issue in Recovery V2 /confirm API when the channel is EXTERNAL. It will be fixed with #16884

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants