com.iplanet.sso
Interface SSOToken


public interface SSOToken

The SSOToken class represents a "single sign on"(SSO) token. It contains SSO token-related information such as authentication method used for authentication, authentication level of the authentication method, host name of the client that sent the request (browser). It also contains session-related information such as maximum session time, maximum session idle time and session idle time.


Method Summary
 void addSSOTokenListener(SSOTokenListener listener)
          Adds an SSO token listener for the token change events.
 java.lang.String encodeURL(java.lang.String url)
          Returns the encoded URL , rewritten to include the session id.
 int getAuthLevel()
          Returns the authentication level of the authentication method used for authentication.
 java.lang.String getAuthType()
          Returns the authentication method used for authentication.
 java.lang.String getHostName()
          Returns the host name of the client (browser) that sent the request.
 long getIdleTime()
          Returns the session idle time in seconds.
 java.net.InetAddress getIPAddress()
          Returns the IP Address of the client (browser) that sent the request.
 long getMaxIdleTime()
          Returns the maximum session idle time in minutes.
 long getMaxSessionTime()
          Returns the maximum session time in minutes.
 java.security.Principal getPrincipal()
          Returns the value of the property "Principal" set to the single sign on token.
 java.lang.String getProperty(java.lang.String name)
          Gets the property stored in this token.
 long getTimeLeft()
          Returns the time left in seconds on the session based on max session time.
 SSOTokenID getTokenID()
          Returns single sign on token ID object.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets a property for this token.
 

Method Detail

getPrincipal

public java.security.Principal getPrincipal()
                                     throws SSOException
Returns the value of the property "Principal" set to the single sign on token.
Returns:
The principal name
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the principal

getAuthType

public java.lang.String getAuthType()
                             throws SSOException
Returns the authentication method used for authentication.
Returns:
The authentication method
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the authentication method

getAuthLevel

public int getAuthLevel()
                 throws SSOException
Returns the authentication level of the authentication method used for authentication.
Returns:
The authentication level
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the authentication level

getIPAddress

public java.net.InetAddress getIPAddress()
                                  throws SSOException
Returns the IP Address of the client (browser) that sent the request.
Returns:
The IP Address of the client
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the IP Address of the client

getHostName

public java.lang.String getHostName()
                             throws SSOException
Returns the host name of the client (browser) that sent the request.
Returns:
The host name of the client
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the host name of the client

getTimeLeft

public long getTimeLeft()
                 throws SSOException
Returns the time left in seconds on the session based on max session time.
Returns:
The time left in seconds on the session.
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the maximum session time.

getMaxSessionTime

public long getMaxSessionTime()
                       throws SSOException
Returns the maximum session time in minutes.
Returns:
The maximum session time in minutes
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the maximum session time

getIdleTime

public long getIdleTime()
                 throws SSOException
Returns the session idle time in seconds.
Returns:
The session idle time in seconds
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the session idle time

getMaxIdleTime

public long getMaxIdleTime()
                    throws SSOException
Returns the maximum session idle time in minutes.
Returns:
The maximum session idle time in minutes
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the maximum idle time

getTokenID

public SSOTokenID getTokenID()
Returns single sign on token ID object.
Returns:
single sign on token ID.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws SSOException
Sets a property for this token.
Parameters:
name - The property name.
value - The property value.
Throws:
SSOException - if the single sign on token is not valid or if there are errors in setting the property name and value

getProperty

public java.lang.String getProperty(java.lang.String name)
                             throws SSOException
Gets the property stored in this token.
Parameters:
name - The property name.
Returns:
The property value in string format.
Throws:
SSOException - if the single sign on token is not valid or if there are errors in getting the property value

addSSOTokenListener

public void addSSOTokenListener(SSOTokenListener listener)
                         throws SSOException
Adds an SSO token listener for the token change events.
Parameters:
listener - A reference to an SSOTokenListener object.
Throws:
SSOException - if the token is not valid or if there are errors in setting the SSO token listener.

encodeURL

public java.lang.String encodeURL(java.lang.String url)
                           throws SSOException
Returns the encoded URL , rewritten to include the session id. The session id will be encoded in the URL as a query string with entity escaping of ampersand when appending the session id to the query string if the query string has other query parameters.

Encoded URL format if query string in the original URL passed is present will be :

  protocol://server:port/path?queryString&cookieName=cookieValue
 
Encoded URL format if query string in the original URL passed is not present will be:
  protocol://server:port/path?cookieName=cookieValue
 
Parameters:
url - the URL to be encoded
Returns:
the encoded URL if cookies are not supported or the URL if cookies are supported. Note: We should not use this method for encoding the image URLs
Throws:
SSOException - if URL cannot be encoded.


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.