apache / apache/cloudstack

User password reset request responds as successful, but fails silently - TTL Issue

Abierto
#13,604 1 comentario 0 reacciones 0 asignados Ver en GitHub
component:authentication
Lenguaje dominante
Java
Estrellas
3.1k
Forks
1.4k
Merge medio
6 d 19 h
PR fusionados (30 d)
32

Descripción

### problem

When a user requests a password reset at the login page, with password reset emails enabled, it returns a successful message to the user and emails them a reset token.
If the user requests another reset within that token's window (user.password.reset.ttl), it will still return a successful message to the user but willl fail internally with the message:
`DEBUG [o.a.c.u.UserPasswordResetManagerImpl] Failed to reset token and send email. Password reset token is already set for user user@emaildomain.com in domain id: xy with account primary and email user@emaildomain.com`

This doesn't appear in the event log of the user either.

### versions

4.22.1.0

### The steps to reproduce the bug

1. Have settings enabled for user password reset (user.password.reset.enabled = true) and an email host configured (user.password.reset.smtp.host)
2. Request a password reset.
3. Observe the first reset email.
4. Request another password reset.

### What to do about it?

There's a few issues here I think should be addressed:
1. Consider if password reset attemps should be visible in the user's Event's page. It might create spam in the events list, so might not be a good idea.
2. Consider either:
- Allowing a user to re-request a new password reset token and reset the TTL window using the new token (my desired outcome, and what I'd expect end-users would be familiar with).
- If not the above, then wait for the email to be successfully queued/sent and return the success from that. If the email isn't sent due to the token being within the TTL, then return a user-friendly message that they cannot request a new token until a specified datetime.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza reproduciendo la segunda solicitud de restablecimiento de contraseña con user.password.reset.enabled y user.password.reset.smtp.host configurados. Lee UserPasswordResetManagerImpl alrededor del fallo registrado y sigue cómo se produce la respuesta de la página de inicio de sesión. Done debería ser un resultado definido y visible para el usuario cuando un token de restablecimiento aún se encuentre dentro de su TTL, con el comportamiento cubierto por las pruebas relevantes de restablecimiento de contraseña.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
authentication, backend
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Necesita aclaración
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.