Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.security
Interface ISecurityContext

All Superinterfaces:
  java.io.Serializable

All Known Subinterfaces:
  IConfigurableSecurityContext

All Known Implementing Classes:
  BrokenSecurityContext, CacheLdapSecurityContext, CacheSecurityContext, CasFilteredSecurityContext, CasSecurityContext, ChainingSecurityContext, JAASSecurityContext, RemoteUserSecurityContext, SimpleLdapSecurityContext, SimpleSecurityContext, TrustSecurityContext, UnionSecurityContext

    public interface ISecurityContext

extends java.io.Serializable

This is the main interface for the JASIG portal effort's security mechanism. We endeavor here to provide considerable encapsulation of the data we are trying to present.

Version:
  $Revision: 1.8 $
Author:
  Andrew Newman, newman@yale.edu, Don Fracapane (df7@columbia.edu) Added getSubContextNames() to support principal and credential tokens

Method Summary
`void` | `addSubContext(java.lang.String name, ISecurityContext ctx)` Adds a named sub context to the list of subserviant subcontexts.
`void` | `authenticate()` Performs the operation of authentication.
`IAdditionalDescriptor` | `getAdditionalDescriptor()` Returns any additional descriptor information that might have been acquired during the process of authentication.
`int` | `getAuthType()` Returns the canonical authentication type for this flavor of authentication.
`IOpaqueCredentials` | `getOpaqueCredentials()` Returns any credentials that an authenticated principal currently has.
`IOpaqueCredentials` | `getOpaqueCredentialsInstance()` Returns an empty object reference to an object implementing the IOpaqueCredentials interface.
`IPrincipal` | `getPrincipal()` Returns the currently authenticated principal if we are currently authenticated.
`IPrincipal` | `getPrincipalInstance()` Returns an empty object reference to an object implementing the Principal interface.
`ISecurityContext` | `getSubContext(java.lang.String ctx)` Returns an `ISecurityContext` for the named subserviant security context.
`java.util.Enumeration` | `getSubContextNames()` Returns an enumeration of the names of the security contexts currently registered as being subserviant to this one.
`java.util.Enumeration` | `getSubContexts()` Returns an enumeration of the security contexts currently registered as being subserviant to this one.
`boolean` | `isAuthenticated()` Returns a boolean status as to whether the descriptor corresponds to an authenticated principal.

Method Detail

### getAuthType

    int getAuthType()

  Returns the canonical authentication type for this flavor of authentication. Each value returned should be either a globally registered auth flavor or a local variant.

  Returns:
    The unique authentication value identifier. Values with the high order 16 bits clear are local (0x0000 - 0x00FF) where values with the high order 16 bits set (0xFF00 - 0xFFFF are foundation types distributed by JASIG. All other should be registered and globally unique.

### getPrincipalInstance

    IPrincipal getPrincipalInstance()

  Returns an empty object reference to an object implementing the Principal interface. By operating on this returned object the implementation class for the credentials type will be able to access any values set in the instance without exposing an interface method that would allow others (inappropriate) acces to the fields.

  Returns:
    An empty principal container.
  See Also:
    `IPrincipal`

### getOpaqueCredentialsInstance

    IOpaqueCredentials getOpaqueCredentialsInstance()

  Returns an empty object reference to an object implementing the IOpaqueCredentials interface. By operating on this returned object the implementation class for the credentials type will be able to access any values set in the Opaque credentials without exposing an interface method that would allow others to access the fields.

  Returns:
    An empty credentials container.
  See Also:
    `IOpaqueCredentials`

### authenticate

    void authenticate()
                      throws PortalSecurityException

  Performs the operation of authentication. To perform this operation, the values set in the Principal object (whose reference is returned by `getPrincipalInstance()`) and the OpaqueCredentials object (whose reference is returned by `getOpaqueCredentialsInstance()`).

  Throws:
    `PortalSecurityException`
  See Also:
    `getPrincipalInstance()`, `getOpaqueCredentialsInstance()`

### getPrincipal

    IPrincipal getPrincipal()

  Returns the currently authenticated principal if we are currently authenticated. Note that merely testing this for a non-null pointer is not sufficient to verify authenticated status. The isAuthenticated() call should be used. In some authentication schemes, an asyncronous event could potentially change one's authentication status.

  Returns:
    The currently authenticated principal.

### getOpaqueCredentials

    IOpaqueCredentials getOpaqueCredentials()

  Returns any credentials that an authenticated principal currently has. Note that opaque credentials don't have any methods for examination of the credentials contents. This call would primarily be useful to chain authentication manually within the same authentication schem.

  Returns:
    The currently authenticated credentials object.
  See Also:
    `IOpaqueCredentials`

### getAdditionalDescriptor

    IAdditionalDescriptor getAdditionalDescriptor()

  Returns any additional descriptor information that might have been acquired during the process of authentication. Note that this interface has no methods and the object returned will have to be cast to some concrete type or alternate interface to be useful.

  Returns:
    An object containing any additional descriptor information.
  See Also:
    `IAdditionalDescriptor`

### isAuthenticated

    boolean isAuthenticated()

  Returns a boolean status as to whether the descriptor corresponds to an authenticated principal. Note that the get(Principaal|OpaqueCredentials) calls return null until isAuthenticated first returns `true`.

### getSubContext

    ISecurityContext getSubContext(java.lang.String ctx)
                                   throws PortalSecurityException

  Returns an `ISecurityContext` for the named subserviant security context.

  Parameters:
    `ctx` - The non-compound name of the subserviant security context.
  Returns:
    The security context object reference associated with the name specified as the first parameter.
  Throws:
    `PortalSecurityException`

### getSubContexts

    java.util.Enumeration getSubContexts()

  Returns an enumeration of the security contexts currently registered as being subserviant to this one.

  Returns:
    The enumeration object containing all of the contexts.

### getSubContextNames

    java.util.Enumeration getSubContextNames()

  Returns an enumeration of the names of the security contexts currently registered as being subserviant to this one.

  Returns:
    The enumeration object containing all of the subcontext names.

### addSubContext

    void addSubContext(java.lang.String name,
                       ISecurityContext ctx)
                       throws PortalSecurityException

  Adds a named sub context to the list of subserviant subcontexts.

  Parameters:
    `name` - The non-compound name of the subserviant context. Note that under normal circumstances the establishment of the InitialSecurityContext will automatically register all subcontext.
    `ctx` - The security context object to register.
  Throws:
    `PortalSecurityException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD