SaFi Bank Space : Session management

AuthRepositoryImpl → responsible to perform authentication requests (register, login, logout) and saves user identification to persistence (customerId, credentialId, name)

IAMOnboardingUsecase → registration usecase for setup with random uuid password and following change of this temporary password to one user filled in

AuthUsecase → used to contact AuthRepository for login, verify and signMessage

LogoutUsecase → to perform “hard logout“ where user data are completely removed

BaseAuthenticationBloc → basic bloc to work with authentication state

  • handles soft logout, non first time login, and locked (when user filled wrong pw too many times)

  • listens to Session expired bus event (and performs soft logout)

AuthenticationBloc → full bloc to work with authentication state

  • handles interactions with session timeout (app started, on interaction, on keep logged in, on app resume, on UI disposed, on about to expire)

  • handles first time login and hard logout

  • prepares readiness

  • does session timeout timer (session duration 300sec, dialog counter duration 30sec)

SessionTimeout → widget wrapping our widget tree

  • reports interaction events to AuthenticationBloc

  • listens to session expiration events and performs “bottom sheet display“ and “navigation“ (about to expire sheet, navigation to password input, navigation to welcome page)