support different refresh token expiries per user group

0

Hi,

I have on cognito user pool with 3 user groups, super_admin, facility_admin and facility_user. Our business requirement states that there are different expiry times for each user type. Currently, they are all part of the same Userpool with 1 app client. Thus they all share the same expiry settings.

This forces me to handle the expiry on the client side, which can be problematic (maintaining expiry times that can fail when browser tab goes to sleep etc).

I was look at a couple of options:

  • create different app clients with different expiry times and then based on user group type load the correct app client. Not sure if this is possible or hacky. Plus it has a problem, that for example, for the super_admin, we want a refresh token that is shorter than 60 minutes. More like 15 minutes. Which is not supported.
  • Use a lambda trigger to change the refresh token expiry? Set a custom expiry that get's renewed when an access Token is renewed? Not sure if this is possible.

Is there a solution that AWS would prefer, which is safe and easy to implement. Surely, I am not the first one to have different expiry times for access and refresh token based on user role?

Mattijs
preguntada hace 9 meses34 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas