public void updateUser(SSOUser user) throws SSOException{ try{ ssoUserManagerSPI.updateUser(user); } catch (SecurityException secex){ throw new SSOException("Unable to update user:",secex); } }
throw new SSOException("SSO Not supported."); throw new Exception("SSO credential lookup failed. Error: " + ssoex.getMessage());
protected Collection<SSOUser> getRemoteUsers(JetspeedPrincipal p) throws SSOException { try{ return ssoUserManagerSPI.getUsers(p); } catch (SecurityException secex){ throw new SSOException(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 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> 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()); } }
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); } }
public SSOSite add(SSOSite ssoSite) throws SSOException { try { getPersistenceBrokerTemplate().store(ssoSite); cacheSite(ssoSite); return ssoSite; } catch (Exception e) { String msg = "Unable to add SSO Site: " + ssoSite.getName(); log.error(msg, e); throw new SSOException(msg, e); } }
public void remove(SSOSite site) throws SSOException { try { getPersistenceBrokerTemplate().delete(site); removeSiteFromCache(site); } catch (Exception e) { String msg = "Unable to remove SSO Site: " + site.getName(); log.error(msg, e); throw new SSOException(msg, e); } }
public void update(SSOSite site) throws SSOException { try { getPersistenceBrokerTemplate().store(site); cacheSite(site); } catch (Exception e) { String msg = "Unable to remove SSO Site: " + site.getName(); log.error(msg, e); throw new SSOException(msg, e); } }
throw new SSOException ("SSO Component Error. Failed to get content for URL " + destUrl, ioe); throw new SSOException ("SSO Component Error. Failed to get content for URL " + destUrl, e);
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); } }
} catch (MalformedURLException muex){ log.error(muex.getMessage(), muex); throw new SSOException("SSO: Marlformed url: "+site.getURL()); } catch (IOException ioe){ log.error("SSO: Error executing get method for url "+site.getURL()); throw new SSOException(ioe);
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); } }
public void removeSite(SSOSite site) throws SSOException { SecurityDomain domain = domainAccessManager.getDomain(site.getSecurityDomainId()); if (domain != null){ try{ domainStorageManager.removeDomain(domain); } catch (SecurityException secex){ throw new SSOException("Unable to remove security domain (id:"+site.getSecurityDomainId()+") associated with the SSO Site "+site.getName()); } } ssoSiteManagerSPI.remove(site); }
protected SSOSite addSite(Long ownerDomainId, SSOSite site) throws SSOException throw new SSOException(SSOException.SITE_ALREADY_EXISTS); } catch(SecurityException sx){ log.error("Could not add remote security domain with name "+site.getName()+" for owner domain "+ownerDomainId); throw new SSOException(SSOException.SITE_COULD_NOT_BE_CREATED,sx); throw new SSOException(SSOException.SITE_COULD_NOT_BE_CREATED); throw new SSOException(se);
public void updateSite(SSOSite site) throws SSOException { SSOSite currentSite = ssoSiteManagerSPI.getById(site.getId()); if (currentSite == null){ throw new SSOException("Unable to update site: site doesn't exist."); } if (!currentSite.getName().equals(site.getName())){ if (domainAccessManager.getDomainByName(site.getName()) != null){ throw new SSOException("Unable to rename site to '"+site.getName()+"': a security domain with that name already exists!"); } SecurityDomain domain = domainAccessManager.getDomain(currentSite.getSecurityDomainId()); SecurityDomainImpl renamedDomain = new SecurityDomainImpl(domain); renamedDomain.setName(site.getName()); try{ domainStorageManager.updateDomain(renamedDomain); } catch (SecurityException secex){ throw new SSOException("Unable to rename security domain "+domain.getName()+" to "+site.getName()+".",secex); } } ssoSiteManagerSPI.update(site); }
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; }
throw new SSOException("SSO Not supported.");