com.sun.liberty
Class LibertyManager

java.lang.Object
  |
  +--com.sun.liberty.LibertyManager

public class LibertyManager
extends java.lang.Object

LibertyManager forms the basis of the Public APIs. It has all the methods which the JSPs etc. need to use for federation/termination/logout etc.


Constructor Summary
LibertyManager()
           
 
Method Summary
static boolean checkNonce(java.lang.String nonce, java.lang.String user)
          Checks that the given nonce is the same as the last one returned via getNonce(), and invalidates it.
static java.lang.String cleanQueryString(HttpServletRequest request)
           
static java.lang.String getConsentHandlerURL(HttpServletRequest request)
          Returns the ConstentHandler
static java.lang.String getCOTKey()
          Returns the COT key from IFSCostants
static java.lang.String getErrorPageURL(java.lang.String providerId, HttpServletRequest request)
          Returns the provider's ErrorPage
static java.util.Set getFederatedProviders(java.lang.String userName)
          Returns the Set of federated Providers for this UserName using Account Mgmt API.
static java.lang.String getFederationDonePageURL(java.lang.String providerID, HttpServletRequest request)
          returns the FederationDonePageURL from the providerID
static java.lang.String getFederationHandlerURL(HttpServletRequest request)
          Returns the FederationHandler
static java.lang.String getFedErrorKey()
          Returns Federation Error Key
static java.lang.String getFedRemarkKey()
          Returns FederationRemark Key
static java.lang.String getHomeURL(java.lang.String providerID)
          Return Provider's HomePageURL
static boolean getIDPFederationStatus(java.lang.String user, java.lang.String provider)
          Gets the federation status of a userName with an IDP (This method assumes that the user is already federated with the provider)
static java.util.Iterator getIDPList()
          Returns a list of all trusted IDPs(Identity Providers)
static java.util.Iterator getIDPList(java.lang.String hostedProviderID)
          Returns a list of all trusted IDPs for a given hostedProviderID
static java.lang.String getInterSiteURL(HttpServletRequest request)
          Returns the interSiteURL from IFSConstants
static java.lang.String getIntroducedProvider(HttpServletRequest request)
          Gets the ID of the provider discovered via the introduction protocol.
static java.util.Set getListOfCOTs(java.lang.String providerId)
          Returns the List of COTs for the given Provider.
static java.lang.String getLoginURL(HttpServletRequest request)
          Returns the LoginURL from IFSConstants
static java.lang.String getLRURLKey()
          Returns the LRURLKey from IFSConstants
static java.lang.String getMetaAlias(java.lang.String providerID)
          returns metaAlias from providerID
static java.lang.String getMetaAliasKey()
          Returns the metaAliasKey from IFSConstants
static java.lang.String getNewRequest(HttpServletRequest request)
          creates New RequestID from the HttpRequestServlet.
static java.lang.String getNonce(java.lang.String user)
          Gets a nonce for use in forms to be posted to well known servlets.
static java.lang.String getPreLoginServletURL(java.lang.String providerID, HttpServletRequest request)
          Returns PreLoginServlet URL and appends metaAlias to it.
static java.lang.String getProviderID(java.lang.String metaAlias)
          Returns providerID from the ProviderAlias using AllianceMgmt calls.
static java.lang.String getProviderIDKey()
          Returns the providerIDKey from IFSConstans
static java.util.Set getProvidersToFederate(java.lang.String providerID, java.lang.String userName)
          Returns the list of all Trusted IDPs of this user not already federated with.
static java.lang.String getRequestIDKey()
          Returns the requestIDKey from IFSConstants.
static java.lang.String getSelectedProviderKey()
          Returns the selectedProviderKey from IFSCosntants
static boolean getSPFederationStatus(java.lang.String user, java.lang.String provider)
          Gets the federations status of a user with an SP(This method assumes that the user is already federated with the provider)
static java.util.Iterator getSPList()
          Returns a list of all trusted SPs (Service Providers)
static java.util.Iterator getSPList(java.lang.String hostedProviderID)
          Returns a list of all trusted SPs (Service Providers) for this hostedProvider
static java.lang.String getSuccintID(java.lang.String providerID)
           
static java.lang.String getTerminationDonePageURL(java.lang.String providerID, HttpServletRequest request)
          returns the TerminationDonePageURL from the providerID
static java.lang.String getTerminationProviderIDKey()
          Returns the termination providerIDKey from IFSConstants.
static java.lang.String getTerminationURL(java.lang.String providerID, HttpServletRequest request)
          Returns TerminationURL
static java.lang.String getUser(HttpServletRequest request)
          Returns the user from HttpServletRequest
static boolean isFederationCancelled(HttpServletRequest request)
          returns a boolean indicating whether Termination has succeeded or failed.
static boolean isLogoutSuccess(HttpServletRequest request)
          returns a boolean indicating whether logout has succeeded or failed.
static boolean isTerminationCancelled(HttpServletRequest request)
          returns a boolean indicating whether Termination has been cancelled.
static boolean isTerminationSuccess(HttpServletRequest request)
          returns a boolean indicating whether Termination has succeeded or failed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibertyManager

public LibertyManager()
Method Detail

getIDPList

public static java.util.Iterator getIDPList()
Returns a list of all trusted IDPs(Identity Providers)
Returns:
an iterator to a list of strings, each containing the provider ID of an IDP

getIDPList

public static java.util.Iterator getIDPList(java.lang.String hostedProviderID)
Returns a list of all trusted IDPs for a given hostedProviderID
Parameters:
hostedProviderID -  
Returns:
an iterator to a list of strings, each containing the provider ID of an IDP for this hostedProviderID

getSPList

public static java.util.Iterator getSPList()
Returns a list of all trusted SPs (Service Providers)
Returns:
an iterator to a list of strings, each containing the providerID of an SP

getSPList

public static java.util.Iterator getSPList(java.lang.String hostedProviderID)
Returns a list of all trusted SPs (Service Providers) for this hostedProvider
Parameters:
hostedProviderID -  
Returns:
an iterator to a list of strings, each containing the providerID of an SP for the given hostedProvider

getIDPFederationStatus

public static boolean getIDPFederationStatus(java.lang.String user,
                                             java.lang.String provider)
Gets the federation status of a userName with an IDP (This method assumes that the user is already federated with the provider)
Parameters:
user - The userName obtained by calling getRemoteUser() on a Liberty-authenticated HttpServletRequest from the user
provider - The provider ID of the IDP
Returns:
The federation status of a user with an IDP

getSPFederationStatus

public static boolean getSPFederationStatus(java.lang.String user,
                                            java.lang.String provider)
Gets the federations status of a user with an SP(This method assumes that the user is already federated with the provider)
Parameters:
user - The userName obtained by calling getRemoteUser() on a Liberty-authenticated HttpServletRequest from the user
provider - The provider ID of the SP
Returns:
The federation status of a user with an SP

getNonce

public static java.lang.String getNonce(java.lang.String user)
Gets a nonce for use in forms to be posted to well known servlets. Avoids cross site scripting type attacks.
Parameters:
user - The username obtained by calling getRemoteUser() on a Liberty-authenticated HttpServletRequest from the user.
Returns:
A string to be put in a hidder form field called "nonce"

checkNonce

public static boolean checkNonce(java.lang.String nonce,
                                 java.lang.String user)
Checks that the given nonce is the same as the last one returned via getNonce(), and invalidates it.
Parameters:
nonce - String conatining nonce
user - Username passed to getNonce to obtain nonce

getIntroducedProvider

public static java.lang.String getIntroducedProvider(HttpServletRequest request)
Gets the ID of the provider discovered via the introduction protocol. If null, no provider was discovered. Can be passed to LoginServlet if null.
Returns:
the providerID

getMetaAliasKey

public static java.lang.String getMetaAliasKey()
Returns the metaAliasKey from IFSConstants

getTerminationProviderIDKey

public static java.lang.String getTerminationProviderIDKey()
Returns the termination providerIDKey from IFSConstants.

getRequestIDKey

public static java.lang.String getRequestIDKey()
Returns the requestIDKey from IFSConstants.

getProviderIDKey

public static java.lang.String getProviderIDKey()
Returns the providerIDKey from IFSConstans

getLRURLKey

public static java.lang.String getLRURLKey()
Returns the LRURLKey from IFSConstants

getCOTKey

public static java.lang.String getCOTKey()
Returns the COT key from IFSCostants

getSelectedProviderKey

public static java.lang.String getSelectedProviderKey()
Returns the selectedProviderKey from IFSCosntants

getFedErrorKey

public static java.lang.String getFedErrorKey()
Returns Federation Error Key

getFedRemarkKey

public static java.lang.String getFedRemarkKey()
Returns FederationRemark Key

getUser

public static java.lang.String getUser(HttpServletRequest request)
Returns the user from HttpServletRequest

getHomeURL

public static java.lang.String getHomeURL(java.lang.String providerID)
Return Provider's HomePageURL

getPreLoginServletURL

public static java.lang.String getPreLoginServletURL(java.lang.String providerID,
                                                     HttpServletRequest request)
Returns PreLoginServlet URL and appends metaAlias to it.

getLoginURL

public static java.lang.String getLoginURL(HttpServletRequest request)
Returns the LoginURL from IFSConstants

getInterSiteURL

public static java.lang.String getInterSiteURL(HttpServletRequest request)
Returns the interSiteURL from IFSConstants

getProviderID

public static java.lang.String getProviderID(java.lang.String metaAlias)
Returns providerID from the ProviderAlias using AllianceMgmt calls.
Parameters:
metaAlias - The metaAlias of the provider
Returns:
providerID The providerID corresponding to the metaAlias.

getProvidersToFederate

public static java.util.Set getProvidersToFederate(java.lang.String providerID,
                                                   java.lang.String userName)
Returns the list of all Trusted IDPs of this user not already federated with. This is a subset of the Set returned by getIDPList(). This method is is used to show the drop-down menu consisting of all the IDPs that the user is not already federated with.
Parameters:
hostedProviderID -  
Returns:
IDPList Set containing all the IDPs which the user is not already federated with.

getFederatedProviders

public static java.util.Set getFederatedProviders(java.lang.String userName)
Returns the Set of federated Providers for this UserName using Account Mgmt API.
Parameters:
userName - for which the federated providers are to be returned.
Returns:
federatedProviders a Set containing the providerIDs of federated providers for the given userName.

getListOfCOTs

public static java.util.Set getListOfCOTs(java.lang.String providerId)
Returns the List of COTs for the given Provider.
Returns:
COTSet the Set containing the COTs for the given provider

getMetaAlias

public static java.lang.String getMetaAlias(java.lang.String providerID)
returns metaAlias from providerID

getFederationDonePageURL

public static java.lang.String getFederationDonePageURL(java.lang.String providerID,
                                                        HttpServletRequest request)
returns the FederationDonePageURL from the providerID

getTerminationDonePageURL

public static java.lang.String getTerminationDonePageURL(java.lang.String providerID,
                                                         HttpServletRequest request)
returns the TerminationDonePageURL from the providerID

getTerminationURL

public static java.lang.String getTerminationURL(java.lang.String providerID,
                                                 HttpServletRequest request)
Returns TerminationURL

getErrorPageURL

public static java.lang.String getErrorPageURL(java.lang.String providerId,
                                               HttpServletRequest request)
Returns the provider's ErrorPage

getFederationHandlerURL

public static java.lang.String getFederationHandlerURL(HttpServletRequest request)
Returns the FederationHandler

getConsentHandlerURL

public static java.lang.String getConsentHandlerURL(HttpServletRequest request)
Returns the ConstentHandler

isLogoutSuccess

public static boolean isLogoutSuccess(HttpServletRequest request)
returns a boolean indicating whether logout has succeeded or failed. returns True if logout succeeds and false if logout fails.

isTerminationSuccess

public static boolean isTerminationSuccess(HttpServletRequest request)
returns a boolean indicating whether Termination has succeeded or failed. returns True if Termination succeeds and false if termination fails.

isFederationCancelled

public static boolean isFederationCancelled(HttpServletRequest request)
returns a boolean indicating whether Termination has succeeded or failed. returns True if Federation is cancelled.

isTerminationCancelled

public static boolean isTerminationCancelled(HttpServletRequest request)
returns a boolean indicating whether Termination has been cancelled. returns True if Termination is cancelled.

getNewRequest

public static java.lang.String getNewRequest(HttpServletRequest request)
creates New RequestID from the HttpRequestServlet.

cleanQueryString

public static java.lang.String cleanQueryString(HttpServletRequest request)

getSuccintID

public static java.lang.String getSuccintID(java.lang.String providerID)