@SuppressWarnings("unchecked") @Override public List<User> getResults() { return (List<User>) super.getResults(); }
/** * Return the filter for the principals name. The name can contain a * wildcard at the right end. * * @return the nameFilter */ public String getNameFilter() { return (String) this.get(NAME_FILTER); }
public AuthenticatedUser authenticate(String userName, String password) throws SecurityException { PasswordCredential credential = upcm.getAuthenticatedPasswordCredential(userName, password); User user = credential.getUser(); if (user == null) { user = um.getUser(credential.getUserName()); } return new AuthenticatedUserImpl(user, new UserCredentialImpl(credential)); } }
public static Subject createSubject(AuthenticatedUser user, Set<Principal> principals) { return createSubject(user.getUser(), user.getPublicCredentials(), user.getPrivateCredentials(), principals); }
public Subject getSubject(AuthenticatedUser user) throws SecurityException { Set<Principal> principals = new PrincipalsSet(); resolveSubjectPrincipals(user, principals); return JetspeedSubjectFactory.createSubject(user.getUser(), getPublicCredentialsForSubject(user), getPrivateCredentialsForSubject(user), principals); }
private JSPrincipalAssociation createJSPrincipalAssociation(String associationName, JetspeedPrincipal from, JetspeedPrincipal to) { JSPrincipalAssociation jsAssoc = new JSPrincipalAssociation(); jsAssoc.setName(associationName); jsAssoc.setFromType(from.getType().getName()); jsAssoc.setFromName(from.getName()); jsAssoc.setToType(to.getType().getName()); jsAssoc.setToName(to.getName()); return jsAssoc; }
public AssociationHandlerKey(JetspeedPrincipalAssociationHandler jpah) { this(jpah.getAssociationType().getAssociationName(), jpah.getAssociationType().getFromPrincipalType() .getName(), jpah.getAssociationType() .getToPrincipalType().getName()); }
public String getName() { return user.getName(); } public User getUser()
protected JetspeedPrincipal getJetspeedPrincipal(String principalType, String principalName) throws SecurityException { JetspeedPrincipalManager principalManager = principalManagerProvider.getManager(principalManagerProvider.getPrincipalType(principalType)); if (principalManager != null) { return principalManager.getPrincipal(principalName); } throw new SecurityException(SecurityException.UNKNOWN_PRINCIPAL_TYPE.create(principalType)); }
public SecurityAttributeTypes getSecurityAttributeTypes() { return jp.getType().getAttributeTypes(); }
/** * Create a user result list from a JetspeedPrincipalResultList. * * @param jprl */ public UserResultList(JetspeedPrincipalResultList jprl) { super(jprl.getResults(), jprl.getTotalSize()); }
protected void refreshProxy() { if (this.ums == null) { LoginModuleProxy loginModuleProxy = LoginModuleProxyImpl.loginModuleProxy; if (loginModuleProxy != null) { this.authProvider = loginModuleProxy.getAuthenticationProvider(); this.ums = loginModuleProxy.getUserManager(); } } }
/** * Resets the count of invalid authentications to zero (0). */ public void beforeSetPassword(PasswordCredential credential, String password) throws SecurityException { credential.setAuthenticationFailures(0); } }
public synchronized JetspeedPrincipalType getType() { if (jpt == null) { jpt = jpmp.getPrincipalType(type); } return jpt; }
public boolean isRequired() { return persistent ? type.isRequired() : false; }
public String getUserName() { return user.getName(); } }
/** * @return the length */ public Long getLength() { return (Long) this.get(LENGTH); }
/** * @return The username. */ public String getUserName() { return user != null ? user.getName() : userName; }
/** * Returns all groups the principal must be member of. * * @return the associatedGroups */ @SuppressWarnings("unchecked") public List<String> getAssociatedGroups() { return (List<String>) this.get(ASSOCIATED_GROUPS); }