public PasswordCredential getPasswordCredential(SSOUser user) throws SecurityException { return credentialAccessManager.getPasswordCredential(user.getName(),user.getDomainId()); }
public Collection<SSOUser> getRemoteUsers(SSOSite site, Subject subject) throws SSOException { Map<Long,SSOUser> resultUsers = new HashMap<Long,SSOUser>(); for (Principal p : subject.getPrincipals()){ if (p instanceof JetspeedPrincipal){ try{ Collection<SSOUser> usersForThisPrincipal = getRemoteUsers(site,(JetspeedPrincipal)p); for (SSOUser user : usersForThisPrincipal) { if (!resultUsers.containsKey(user.getId())){ resultUsers.put(user.getId(), user); } } } catch (SSOException se){ throw new SSOException(se); } } } return resultUsers.values(); }
public void addAssociation(SSOUser user, JetspeedPrincipal principal) throws SSOException { try{ ssoUserManagerSPI.addSSOUserToPrincipal(user, principal); } catch (SecurityException secex){ throw new SSOException("Unable to associate principal "+principal.getName() + " with SSO user "+user.getName()); } }
@SuppressWarnings("unchecked") public Collection<SSOSite> getSites(Collection<SSOUser> users) { if (users.size() > 0){ Criteria queryCriteria = new Criteria(); for (SSOUser u : users){ Criteria domainCriteria = new Criteria(); domainCriteria.addEqualTo("securityDomainId",u.getDomainId()); queryCriteria.addOrCriteria(domainCriteria); } QueryByCriteria query = QueryFactory.newQuery(SSOSiteImpl.class, queryCriteria); query.addOrderByAscending("name"); return getPersistenceBrokerTemplate().getCollectionByQuery(query); } else { return Collections.EMPTY_LIST; } }
if (ruCredential != null) String ruName = ru.getName(); String rupType = null; String rupName = null;
public void removeUser(SSOUser remoteUser) throws SSOException { try{ ssoUserManagerSPI.removeUser(remoteUser.getName(), remoteUser.getDomainId()); } catch (SecurityException secex){ throw new SSOException("Unable to remove SSO User "+remoteUser.getName(),secex); } }
public Collection<JetspeedPrincipal> getPortalPrincipals(SSOUser remoteUser, Long portalPrincipalDomain) { Collection<JetspeedPrincipal> principalsFound = new ArrayList<JetspeedPrincipal>(); List<JetspeedPrincipalAssociationType> assTypes = super.getAssociationTypes(); for (JetspeedPrincipalAssociationType type : assTypes) { if (type.getAssociationName().equals(IsRemoteIdentityForPrincipalAssociationHandler.ASSOCIATION_NAME)){ Collection<JetspeedPrincipal> principalsForThisType = domainPrincipalAccess.getAssociatedFrom(remoteUser.getName(), getPrincipalType(), type.getToPrincipalType(), IsRemoteIdentityForPrincipalAssociationHandler.ASSOCIATION_NAME, remoteUser.getDomainId(), portalPrincipalDomain); principalsFound.addAll(principalsForThisType); } } return principalsFound; }