com.filenet.api.authentication
Class SubjectCredentials
- java.lang.Object
-
- com.filenet.api.authentication.Credentials
-
- com.filenet.api.authentication.SubjectCredentials
-
public class SubjectCredentials extends Credentials
This class is a type ofCredentials
object which holds an a JAASSubject
representing the authenticated user.Use of this class supersedes the Subject-related methods in the
UserContext
class.This is the only form of credentials that can be used with the EJB transport. It may also be used with the WSI transport.
- Since:
- Version 5.5.9.
-
-
Constructor Summary
Constructors Constructor and Description SubjectCredentials(javax.security.auth.Subject subject)
Constructs an instance holding the specifiedSubject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description <T> T
doAs(java.security.PrivilegedExceptionAction<T> pea)
Executes thePrivilegedExceptionAction
in the security context authenticated by theSubject
held by this object.boolean
equals(java.lang.Object other)
javax.security.auth.Subject
getSubject()
Returns theSubject
held by this object.int
hashCode()
java.lang.String
toString()
-
Methods inherited from class com.filenet.api.authentication.Credentials
getCurrent
-
-
-
-
Constructor Detail
-
SubjectCredentials
public SubjectCredentials(javax.security.auth.Subject subject)
Constructs an instance holding the specifiedSubject
- Parameters:
subject
- TheSubject
to be held.
-
-
Method Detail
-
getSubject
public javax.security.auth.Subject getSubject()
Returns theSubject
held by this object.- Returns:
- The
Subject
.
-
doAs
public <T> T doAs(java.security.PrivilegedExceptionAction<T> pea)
Executes thePrivilegedExceptionAction
in the security context authenticated by theSubject
held by this object.This method saves the currently active credentials (see
Credentials.getCurrent()
) and makes the target object active for the duration of the action execution. It also places theSubject
into the ambient JAAS context, so it will be in effect for all software, not just the CE API.- Overrides:
doAs
in classCredentials
- Parameters:
pea
- The action to execute- Returns:
- The value returned by the
PrivilegedExceptionAction.run()
method.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-