public void setPassword(SSOUser user, String pwd) throws SSOException { PasswordCredential pwdCred = null; try{ pwdCred=ssoUserManagerSPI.getPasswordCredential(user); } catch (SecurityException secex){ } if (pwdCred != null){ pwdCred.setPassword(pwd, false); } else { pwdCred=new PasswordCredentialImpl(user,pwd); } try{ ssoUserManagerSPI.storePasswordCredential(pwdCred); } catch (SecurityException sx){ throw new SSOException(sx); } }
protected Collection<SSOUser> getRemoteUsers(JetspeedPrincipal p) throws SSOException { try{ return ssoUserManagerSPI.getUsers(p); } catch (SecurityException secex){ throw new SSOException(secex); } }
public void updateUser(SSOUser user) throws SSOException{ try{ ssoUserManagerSPI.updateUser(user); } catch (SecurityException secex){ throw new SSOException("Unable to update user:",secex); } }
public PasswordCredential getCredentials(SSOUser user) throws SSOException { try{ return ssoUserManagerSPI.getPasswordCredential(user); } catch (SecurityException secex){ // TODO provide meaningful message throw new SSOException(secex); } }
public SSOUser getRemoteUser(SSOSite site, String remoteUsername ) { try{ return ssoUserManagerSPI.getUser(remoteUsername, site.getSecurityDomainId()); } catch (SecurityException secex){ log.debug("Could not find SSO user with name "+remoteUsername+" from remote site "+site.getName()+" (domain id: "+site.getSecurityDomainId()+")", secex); return null; } }
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()); } }
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 user) { SSOSite site = ssoSiteManagerSPI.getSite(user); if (site != null){ SecurityDomain ssoDomain = domainAccessManager.getDomain(site.getSecurityDomainId()); SecurityDomain ownerDomain = domainAccessManager.getDomain(ssoDomain.getOwnerDomainId()); return ssoUserManagerSPI.getPortalPrincipals(user,ownerDomain.getDomainId()); } else { return Collections.emptyList(); } }
public SSOUser addUser(SSOSite site, JetspeedPrincipal ownerPrincipal, String ssoUsername, String ssoUserPassword) throws SSOException { SSOUser newUser = null; try{ // step 1. create new SSO user newUser = ssoUserManagerSPI.addUser(ssoUsername, site.getSecurityDomainId(), ownerPrincipal); // step 2. store new user's credentials setPassword(newUser, ssoUserPassword); // step 3. relate owner to SSO user addAssociation(newUser, ownerPrincipal); } catch (SecurityException secex){ // revert changes, if applicable if (newUser != null){ removeUser(newUser); } throw new SSOException("Unable to add new SSO User "+ssoUsername,secex); } return newUser; }
public Collection<SSOUser> getRemoteUsers(SSOSite site, JetspeedPrincipal portalPrincipal) throws SSOException { try{ return ssoUserManagerSPI.getUsers(portalPrincipal,site.getSecurityDomainId()); } catch (SecurityException secex){ throw new SSOException(secex); } }
public Collection<SSOUser> getUsersForSite(SSOSite site) throws SSOException { try{ return ssoUserManagerSPI.getUsers("", site.getSecurityDomainId()); } catch (SecurityException e){ throw new SSOException("Could not fetch SSO users for site "+site.getName(),e); } }