org.apache.jetspeed.sso.impl
Class PersistenceBrokerSSOProvider

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
          extended by org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
              extended by org.apache.jetspeed.sso.impl.PersistenceBrokerSSOProvider
All Implemented Interfaces:
SSOProvider, org.springframework.beans.factory.InitializingBean

public class PersistenceBrokerSSOProvider
extends InitablePersistenceBrokerDaoSupport
implements SSOProvider

Utility component to handle SSO requests

Author:
Roger Ruttimann

Field Summary
 
Fields inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
repositoryPath
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
PersistenceBrokerSSOProvider(java.lang.String repositoryPath)
          PersitenceBrokerSSOProvider()
 
Method Summary
 void addCredentialsForSite(java.lang.String fullPath, java.lang.String remoteUser, java.lang.String site, java.lang.String pwd)
          addCredentialsForSite()
 void addCredentialsForSite(javax.security.auth.Subject subject, java.lang.String remoteUser, java.lang.String site, java.lang.String pwd)
           
 void addSite(java.lang.String siteName, java.lang.String siteUrl)
           
 void addSiteChallengeResponse(java.lang.String siteName, java.lang.String siteUrl, java.lang.String realm)
          Add a new site that uses ChallengeResponse Authentication
 void addSiteFormAuthenticated(java.lang.String siteName, java.lang.String siteUrl, java.lang.String realm, java.lang.String userField, java.lang.String pwdField)
          Add a new site that uses Form Authentication
 java.util.Collection getCookiesForUser(java.lang.String fullPath)
          Retrive cookies for an user by User full path
 java.util.Collection getCookiesForUser(javax.security.auth.Subject user)
          Retrive Cookies by Subject
 SSOContext getCredentials(javax.security.auth.Subject subject, java.lang.String site)
           
 java.util.List getPrincipalsForSite(SSOSite site)
          return a list of SSOContext objects containing both the portal principal, remote principal, and credentials
 java.lang.String getRealmForSite(java.lang.String site)
           
 SSOSite getSite(java.lang.String siteUrl)
           
 java.lang.String getSiteName(java.lang.String site)
          getSiteName
 java.util.Iterator getSites(java.lang.String filter)
           
 java.util.Collection getSitesForPrincipal(java.lang.String fullPath)
          Get all SSOSites that the principal has access to
 java.lang.String getSiteURL(java.lang.String site)
          Retrive site information getSiteURL
 boolean hasSSOCredentials(javax.security.auth.Subject subject, java.lang.String site)
          Public API's for SSO functinality
 void removeCredentialsForSite(java.lang.String fullPath, java.lang.String site)
          removeCredentialsForSite()
 void removeCredentialsForSite(javax.security.auth.Subject subject, java.lang.String site)
           
 void removeSite(SSOSite site)
           
 void setRealmForSite(java.lang.String site, java.lang.String realm)
           
 void updateCredentialsForSite(javax.security.auth.Subject subject, java.lang.String remoteUser, java.lang.String site, java.lang.String pwd)
          updateCredentialsForSite
 void updateSite(SSOSite site)
           
 java.lang.String useSSO(javax.security.auth.Subject subject, java.lang.String url, boolean bRefresh)
          Same as the method above except that the user will be authenticated against all SSOSites defined for the user before going to the destination site.
 java.lang.String useSSO(javax.security.auth.Subject subject, java.lang.String url, java.lang.String SSOSite, boolean bRefresh)
          This method first authenticates the the SSOSite and then forwards the request to the destination URL.
 
Methods inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
init
 
Methods inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
checkDaoConfig, closePersistenceBrokerIfNecessary, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, releasePersistenceBroker, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.sso.SSOProvider
init
 

Constructor Detail

PersistenceBrokerSSOProvider

public PersistenceBrokerSSOProvider(java.lang.String repositoryPath)
                             throws java.lang.ClassNotFoundException
PersitenceBrokerSSOProvider()

Parameters:
repository - Location of repository mapping file. Must be available within the classpath.
prefsFactoryImpl - java.util.prefs.PreferencesFactory implementation to use.
enablePropertyManager - Whether or not we chould be suing the property manager.
Throws:
java.lang.ClassNotFoundException - if the prefsFactoryImpl argument does not reperesent a Class that exists in the current classPath.
Method Detail

useSSO

public java.lang.String useSSO(javax.security.auth.Subject subject,
                               java.lang.String url,
                               java.lang.String SSOSite,
                               boolean bRefresh)
                        throws SSOException
Description copied from interface: SSOProvider
This method first authenticates the the SSOSite and then forwards the request to the destination URL. The content will be returned as a string. If the SSOSite and the url match only one call will be executed since the authentication will be done while getting the result page.

Specified by:
useSSO in interface SSOProvider
bRefresh - if true it refreshes the proxy connection if false a cached proxy will be used
Returns:
Throws:
SSOException

useSSO

public java.lang.String useSSO(javax.security.auth.Subject subject,
                               java.lang.String url,
                               boolean bRefresh)
                        throws SSOException
Description copied from interface: SSOProvider
Same as the method above except that the user will be authenticated against all SSOSites defined for the user before going to the destination site.

Specified by:
useSSO in interface SSOProvider
bRefresh - if true it refreshes the proxy connection if false a cached proxy will be used
Returns:
Throws:
SSOException

getCookiesForUser

public java.util.Collection getCookiesForUser(java.lang.String fullPath)
Retrive cookies for an user by User full path

Specified by:
getCookiesForUser in interface SSOProvider
Parameters:
fullPath -
Returns:

getCookiesForUser

public java.util.Collection getCookiesForUser(javax.security.auth.Subject user)
Retrive Cookies by Subject

Specified by:
getCookiesForUser in interface SSOProvider
Parameters:
user -
Returns:

setRealmForSite

public void setRealmForSite(java.lang.String site,
                            java.lang.String realm)
                     throws SSOException
Specified by:
setRealmForSite in interface SSOProvider
Throws:
SSOException

getRealmForSite

public java.lang.String getRealmForSite(java.lang.String site)
                                 throws SSOException
Specified by:
getRealmForSite in interface SSOProvider
Throws:
SSOException

getSitesForPrincipal

public java.util.Collection getSitesForPrincipal(java.lang.String fullPath)
Get all SSOSites that the principal has access to

Specified by:
getSitesForPrincipal in interface SSOProvider
Parameters:
userId -
Returns:

getSites

public java.util.Iterator getSites(java.lang.String filter)
Specified by:
getSites in interface SSOProvider

addCredentialsForSite

public void addCredentialsForSite(java.lang.String fullPath,
                                  java.lang.String remoteUser,
                                  java.lang.String site,
                                  java.lang.String pwd)
                           throws SSOException
addCredentialsForSite()

Specified by:
addCredentialsForSite in interface SSOProvider
Parameters:
fullPath -
remoteUser -
site -
pwd -
Throws:
SSOException

removeCredentialsForSite

public void removeCredentialsForSite(java.lang.String fullPath,
                                     java.lang.String site)
                              throws SSOException
removeCredentialsForSite()

Specified by:
removeCredentialsForSite in interface SSOProvider
Parameters:
fullPath -
site -
Throws:
SSOException

getSiteURL

public java.lang.String getSiteURL(java.lang.String site)
Retrive site information getSiteURL

Specified by:
getSiteURL in interface SSOProvider

getSiteName

public java.lang.String getSiteName(java.lang.String site)
getSiteName

Specified by:
getSiteName in interface SSOProvider

hasSSOCredentials

public boolean hasSSOCredentials(javax.security.auth.Subject subject,
                                 java.lang.String site)
Description copied from interface: SSOProvider
Public API's for SSO functinality

Specified by:
hasSSOCredentials in interface SSOProvider
Returns:

getCredentials

public SSOContext getCredentials(javax.security.auth.Subject subject,
                                 java.lang.String site)
                          throws SSOException
Specified by:
getCredentials in interface SSOProvider
Throws:
SSOException

addCredentialsForSite

public void addCredentialsForSite(javax.security.auth.Subject subject,
                                  java.lang.String remoteUser,
                                  java.lang.String site,
                                  java.lang.String pwd)
                           throws SSOException
Specified by:
addCredentialsForSite in interface SSOProvider
Throws:
SSOException

removeCredentialsForSite

public void removeCredentialsForSite(javax.security.auth.Subject subject,
                                     java.lang.String site)
                              throws SSOException
Specified by:
removeCredentialsForSite in interface SSOProvider
Throws:
SSOException

updateCredentialsForSite

public void updateCredentialsForSite(javax.security.auth.Subject subject,
                                     java.lang.String remoteUser,
                                     java.lang.String site,
                                     java.lang.String pwd)
                              throws SSOException
updateCredentialsForSite

Specified by:
updateCredentialsForSite in interface SSOProvider
Parameters:
subject - Current subject
remoteUser - remote user login
site - URL or description of site
pwd - Password for credentail
Throws:
SSOException

getSite

public SSOSite getSite(java.lang.String siteUrl)
Specified by:
getSite in interface SSOProvider

updateSite

public void updateSite(SSOSite site)
                throws SSOException
Specified by:
updateSite in interface SSOProvider
Throws:
SSOException

addSiteFormAuthenticated

public void addSiteFormAuthenticated(java.lang.String siteName,
                                     java.lang.String siteUrl,
                                     java.lang.String realm,
                                     java.lang.String userField,
                                     java.lang.String pwdField)
                              throws SSOException
Add a new site that uses Form Authentication

Specified by:
addSiteFormAuthenticated in interface SSOProvider
Parameters:
siteName -
siteUrl -
realm -
userField -
pwdField -
Throws:
SSOException

addSiteChallengeResponse

public void addSiteChallengeResponse(java.lang.String siteName,
                                     java.lang.String siteUrl,
                                     java.lang.String realm)
                              throws SSOException
Add a new site that uses ChallengeResponse Authentication

Specified by:
addSiteChallengeResponse in interface SSOProvider
Parameters:
siteName -
siteUrl -
realm -
Throws:
SSOException

addSite

public void addSite(java.lang.String siteName,
                    java.lang.String siteUrl)
             throws SSOException
Specified by:
addSite in interface SSOProvider
Throws:
SSOException

removeSite

public void removeSite(SSOSite site)
                throws SSOException
Specified by:
removeSite in interface SSOProvider
Throws:
SSOException

getPrincipalsForSite

public java.util.List getPrincipalsForSite(SSOSite site)
Description copied from interface: SSOProvider
return a list of SSOContext objects containing both the portal principal, remote principal, and credentials

Specified by:
getPrincipalsForSite in interface SSOProvider
Returns:
list SSOContext objects


Copyright © 1999-2010 Apache Software Foundation. All Rights Reserved.