Class SecondFactorUserResolver

java.lang.Object
com.irurueta.authserver.authorization.api.web.mfa.SecondFactorUserResolver

@Component public class SecondFactorUserResolver extends Object
Resolves the identifier of the account of a signed-in user. The principal Spring Security keeps after a password sign-in carries only the username, while the second-factor use cases work with the account identifier.
  • Field Details

    • findUserAccountUseCase

      private final FindUserAccountUseCase findUserAccountUseCase
      Use case that looks the account up.
  • Constructor Details

    • SecondFactorUserResolver

      public SecondFactorUserResolver()
  • Method Details

    • userIdOf

      public UUID userIdOf(String username)
      Gets the identifier of an account.
      Parameters:
      username - name the user signed in with.
      Returns:
      the identifier of the account.
      Throws:
      org.springframework.security.core.userdetails.UsernameNotFoundException - if there is no such account.