Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 2 (11.1.2)

E27155-01 ESAPI


oracle.security.jps.runtime
Class AppSecurityContext

java.lang.Object
  extended by oracle.security.jps.runtime.AppSecurityContext


public abstract class AppSecurityContext
extends java.lang.Object

This class defines application security context with application security attributes for OPSS policy providers and other security services. Examples of security attributes include application ID and identity context. Policy providers use application ID in application security context to make authorization decisions and perform application policy provisioning tasks. Applications and components can retrieve identity context from application security context to access identity claims.

This class provides a thread-scoped API for accessing application security attributes. The thread scoped API uses a threadlocal variable of an AppSecurityContext instance to encapsulate the application security attributes, e.g. application ID and identity context ID.

AppSecurityContext supports two modes in setting and getting application ID, the new "AppSecurityContext" mode and "PolicyContext" mode. The "PolicyContext" mode provides backward-compatibility in setting and getting context ID with JACC PolicyContext, the "AppSecurityContext" mode creates a new thread-scoped variable to store application ID. This class checks system property "oracle.security.jps.appsecuritycontext.appsecuritycontextmode" to decide which mode to use for setting and getting application ID. If this system property is not set or set to false, "PolicyContext" mode is enabled. Otherwise, "AppSecurityContext" mode is enabled.

When calling AppSecurityContext.setApplicationID method, it requires callers to have codebase permission grant of JpsPermission("AppSecurityContext.setApplicationID.<app ID>").


Method Summary
static java.lang.String getApplicationID()
          Gets application ID from thread-scoped variables.
abstract  java.lang.Object getAttribute(java.lang.String attributeName)
          Gets the security attribute object given its name.
static AppSecurityContext getSecurityContext()
          Gets the instance of AppSecurityContext.
static void setApplicationID(java.lang.String applicationID)
          Sets application ID in thread-scoped variables.
static void setAppSecCtxtMode(boolean appSecCtxtMode)
          Sets the application security context mode to enable or disable "AppSecurityContext" mode.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

setAppSecCtxtMode

public static void setAppSecCtxtMode(boolean appSecCtxtMode)
Sets the application security context mode to enable or disable "AppSecurityContext" mode.
Parameters:
appSecCtxtMode - set to true to enable "AppSecurityContext" mode, false to disable this mode

setApplicationID

public static void setApplicationID(java.lang.String applicationID)
Sets application ID in thread-scoped variables.

It requires callers to have codebase permission grant of JpsPermission("AppSecurityContext.setApplicationID.<app ID>") to invoke this method.

When PolicyContext mode is true and security manager is turned on, PolicyContext requires callers to have permission grant of SecurityPermission("setPolicy").

Parameters:
applicationID -

getApplicationID

public static java.lang.String getApplicationID()
Gets application ID from thread-scoped variables.

When PolicyContext mode is true and security manager is set, PolicyContext requires callers to have permission grant of SecurityPermission("getPolicy").

Returns:
the application ID.

getSecurityContext

public static AppSecurityContext getSecurityContext()
Gets the instance of AppSecurityContext.
Returns:
the instance of AppSecurityContext

getAttribute

public abstract java.lang.Object getAttribute(java.lang.String attributeName)
Gets the security attribute object given its name.
Parameters:
attributeName - the security attribute name
Returns:
the specified attribute object

Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 2 (11.1.2)

E27155-01 ESAPI


Copyright © 2011,2012, Oracle and/or its affiliates. All rights reserved.