com.spotfire.server.security
Class SecurityContext

java.lang.Object
  extended by com.spotfire.server.security.SecurityContext
Direct Known Subclasses:
JAASSecurityContext

public class SecurityContext
extends Object

The SecurityContext class contains information about an authenticated Principal. It also implements the HttpSessionBindingListener interface, so that the Principal can be automatically logged out when its HttpSession instance is invalidated.

Since:
DSS 7.3
See Also:
Serialized Form

Constructor Summary
SecurityContext(String username)
          Creates a new SecurityContext instance.
SecurityContext(String username, String password)
          Deprecated.  
 
Method Summary
 AuthenticationScheme getAuthenticationScheme()
          Returns the authentication scheme used when authenticating the principal.
 String getAuthType()
          Deprecated.  
 String getPassword()
          Deprecated.  
 SpotfirePrincipal getPrincipal()
          Returns the SpotfirePrincipal instance representing the authenicated principal.
 void logout()
          Logs out the principal.
 void setAuthenticationScheme(AuthenticationScheme scheme)
          Sets the authentication scheme used when authenticating the principal.
 void setAuthType(String authType)
          Deprecated.  
 void valueBound(HttpSessionBindingEvent event)
          This HttpSessionBindingListener method is called when the SecurityContext object is bound to an HttpSession instance.
 void valueUnbound(HttpSessionBindingEvent event)
          This HttpSessionBindingListener method is called when the HttpSession instance, to which this SecurityContext object is bound, is invalidated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityContext

public SecurityContext(String username)
Creates a new SecurityContext instance. The arguments are the credentials used when authenticating the principal. The arguments may not be null.

Parameters:
username - the username

SecurityContext

@Deprecated
public SecurityContext(String username,
                                  String password)
Deprecated. 

Creates a new SecurityContext instance. The arguments are the credentials used when authenticating the principal. The arguments may not be null.

Parameters:
username - the username
password - the password
Method Detail

getPrincipal

public final SpotfirePrincipal getPrincipal()
Returns the SpotfirePrincipal instance representing the authenicated principal. This principal object can be used with the DecisionSite Server User Directory API.

Returns:
the authenticated principal

getPassword

@Deprecated
public final String getPassword()
Deprecated. 

This method used to return the principal's password.

The current implementation returns null, and the method will be removed entirely in a future release.

Returns:
null, always

logout

public void logout()
Logs out the principal.

See Also:
SecurityContext.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)

valueUnbound

public final void valueUnbound(HttpSessionBindingEvent event)
This HttpSessionBindingListener method is called when the HttpSession instance, to which this SecurityContext object is bound, is invalidated. The method responds to this event by calling the logout method.

Parameters:
event - a HttpSessionBindingEvent value
See Also:
SecurityContext.logout()

valueBound

public final void valueBound(HttpSessionBindingEvent event)
This HttpSessionBindingListener method is called when the SecurityContext object is bound to an HttpSession instance.

Parameters:
event - a HttpSessionBindingEvent value
See Also:
SecurityContext.logout()

getAuthenticationScheme

public final AuthenticationScheme getAuthenticationScheme()
Returns the authentication scheme used when authenticating the principal.

Returns:
the authentication scheme used when authenticating the principal

setAuthenticationScheme

public final void setAuthenticationScheme(AuthenticationScheme scheme)
Sets the authentication scheme used when authenticating the principal.

Parameters:
scheme - the authentication scheme used when authenticating the principal

setAuthType

@Deprecated
public final void setAuthType(String authType)
Deprecated. 

Sets the name of the authentication scheme which was used when authenticating the principal. Possible values are defined by the AuthenticationScheme enumeration.

This method is deprecated. Use the setAuthenticationScheme method instead.

Parameters:
scheme - the name of the authentication scheme used when authenticating the principal
See Also:
SecurityContext.getAuthType(), SecurityContext.setAuthenticationScheme(com.spotfire.server.security.AuthenticationScheme)

getAuthType

@Deprecated
public final String getAuthType()
Deprecated. 

Returns the name of the authentication scheme which used when authenticating the principal. Possible values are defined by the AuthenticationScheme enumeration.

This method is deprecated. Use the getAuthenticationScheme method instead.

Returns:
the name of the authentication scheme used when authenticating the principal
See Also:
SecurityContext.setAuthType(java.lang.String), SecurityContext.getAuthenticationScheme()


Copyright © 2000-2009 TIBCO Software Inc. All Rights Reserved.