Class UserService

java.lang.Object
io.jans.casa.core.UserService
All Implemented Interfaces:
io.jans.casa.service.SndFactorAuthenticationUtils

@Named @ApplicationScoped public class UserService extends Object implements io.jans.casa.service.SndFactorAuthenticationUtils
An app. scoped bean that encapsulates logic related to users manipulation (CRUD) at memory level (no LDAP storage)
Author:
jgomer
  • Constructor Details

    • UserService

      public UserService()
  • Method Details

    • getUserFromClaims

      public io.jans.casa.core.pojo.User getUserFromClaims(Map<String,Object> claims) throws AttributeNotFoundException
      Throws:
      AttributeNotFoundException
    • getUserMethodsCount

      public List<org.zkoss.util.Pair<io.jans.casa.extension.AuthnMethod,Integer>> getUserMethodsCount(String userId)
    • turn2faOn

      public boolean turn2faOn(io.jans.casa.core.pojo.User user)
      Specified by:
      turn2faOn in interface io.jans.casa.service.SndFactorAuthenticationUtils
    • turn2faOn

      public boolean turn2faOn(io.jans.casa.core.pojo.User user, String method)
      Specified by:
      turn2faOn in interface io.jans.casa.service.SndFactorAuthenticationUtils
    • turn2faOff

      public boolean turn2faOff(io.jans.casa.core.pojo.User user)
      Specified by:
      turn2faOff in interface io.jans.casa.service.SndFactorAuthenticationUtils
    • removalConflict

      public org.zkoss.util.Pair<io.jans.casa.credential.CredentialRemovalConflict,String> removalConflict(String credentialType, int nCredsOfType, io.jans.casa.core.pojo.User user)
      Specified by:
      removalConflict in interface io.jans.casa.service.SndFactorAuthenticationUtils
    • notifyEnrollment

      public void notifyEnrollment(io.jans.casa.core.pojo.User user, String credentialType)
      Specified by:
      notifyEnrollment in interface io.jans.casa.service.SndFactorAuthenticationUtils
    • attemptAutoEnable2FA

      public void attemptAutoEnable2FA(io.jans.casa.core.pojo.User user, int totalCreds)
    • resetPreference

      public int resetPreference(List<String> userInums)
      Resets the preferred method of authentication for the users referenced by LDAP dn
      Parameters:
      userInums - A List containing user DNs
      Returns:
      The number of modified entries in LDAP
    • searchUsers

      public List<Person> searchUsers(String searchString)
      Builds a list of users whose username, first or last name matches the pattern passed, and at the same time have a preferred authentication method other than password
      Parameters:
      searchString - Pattern for search
      Returns:
      A collection of SimpleUser instances. Null if an error occurred to compute the list
    • generateRandEnrollmentCode

      public String generateRandEnrollmentCode(String userId)
    • cleanRandEnrollmentCode

      public void cleanRandEnrollmentCode(String userId)
    • getLiveAuthnMethods

      public List<io.jans.casa.extension.AuthnMethod> getLiveAuthnMethods()