Class CurrentAccountResolver

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

@Component public class CurrentAccountResolver extends Object
Resolves the account of the request being handled. The interfaces generated from the contract carry only the parameters the contract declares, so the principal of the bearer token is taken from the request context.
  • Field Details

    • secondFactorUserResolver

      private final SecondFactorUserResolver secondFactorUserResolver
      Resolves the identifier of an account from its username.
  • Constructor Details

    • CurrentAccountResolver

      public CurrentAccountResolver()
  • Method Details

    • resolve

      public CurrentAccount resolve()
      Gets the account of the current request.
      Returns:
      the account of the principal of the request.
      Throws:
      org.springframework.security.core.userdetails.UsernameNotFoundException - if the principal has no account.
    • resolve

      private CurrentAccount resolve(jakarta.servlet.http.HttpServletRequest request)
      Gets the account of the principal of a request.
      Parameters:
      request - the request.
      Returns:
      the account.