Package io.jans.casa.core
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattemptAutoEnable2FA(io.jans.casa.core.pojo.User user, int totalCreds) voidcleanRandEnrollmentCode(String userId) generateRandEnrollmentCode(String userId) List<io.jans.casa.extension.AuthnMethod>io.jans.casa.core.pojo.UsergetUserFromClaims(Map<String, Object> claims) getUserMethodsCount(String userId) voidnotifyEnrollment(io.jans.casa.core.pojo.User user, String credentialType) org.zkoss.util.Pair<io.jans.casa.credential.CredentialRemovalConflict,String> removalConflict(String credentialType, int nCredsOfType, io.jans.casa.core.pojo.User user) intresetPreference(List<String> userInums) Resets the preferred method of authentication for the users referenced by LDAP dnsearchUsers(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 passwordbooleanturn2faOff(io.jans.casa.core.pojo.User user) booleanturn2faOn(io.jans.casa.core.pojo.User user) boolean
-
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
-
turn2faOn
public boolean turn2faOn(io.jans.casa.core.pojo.User user) - Specified by:
turn2faOnin interfaceio.jans.casa.service.SndFactorAuthenticationUtils
-
turn2faOn
- Specified by:
turn2faOnin interfaceio.jans.casa.service.SndFactorAuthenticationUtils
-
turn2faOff
public boolean turn2faOff(io.jans.casa.core.pojo.User user) - Specified by:
turn2faOffin interfaceio.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:
removalConflictin interfaceio.jans.casa.service.SndFactorAuthenticationUtils
-
notifyEnrollment
- Specified by:
notifyEnrollmentin interfaceio.jans.casa.service.SndFactorAuthenticationUtils
-
attemptAutoEnable2FA
public void attemptAutoEnable2FA(io.jans.casa.core.pojo.User user, int totalCreds) -
resetPreference
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
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
-
cleanRandEnrollmentCode
-
getLiveAuthnMethods
-