com.ibm.sec.authz.jaccplus
Class ApplicationSubject
- java.lang.Object
com.ibm.sec.authz.jaccplus.ApplicationSubject
- public class ApplicationSubject
- extends java.lang.Object
ApplicationEvaluationContext
.
A subject can be set in the context instance as follows:
ApplicationSubject subj = new ApplicationSubject(); subj.setUserPrincipal( new ApplicationUserPrincipal( "cn=alice,o=ibm,c=us" ) ); subj.setGroupPrincipals( new Principal[] { new ApplicationGroupPrincipal( "cn=users,o=ibm,c=us" ) } ); context.getHandlerData().put( ApplicationSubjectContext.SUBJECT_KEY, subj );
Note that any instance of Principal
can be used, as long as Principal.getName()
returns the desired representation of the identity.
Applications can also set an XML representation of an authentication token, such as a WS-Security token, that was used to authenticate the user. This token is sent to the decision engine, and users of TSPM can send this token to a security token service.
See Also:
Constructor Summary
Constructor and Description |
---|
ApplicationSubject()
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
getAuthenticationToken()
This method gets the token used to authenticate.
|
|
getGroupPrincipals()
Gets the principals representing the groups of this subject.
|
|
getUserPrincipal()
Gets the principal representing the user identity for this subject.
|
|
setAuthenticationToken(org.w3c.dom.Element token)
This method sets the token used to authenticate this Subject.
|
|
setGroupPrincipals(java.security.Principal[] prins)
Sets the group principals for this subject.
|
|
setUserPrincipal(java.security.Principal prin)
Sets the principal representing the user identity for this subject.
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
ApplicationSubject
- public ApplicationSubject()
Method Detail
getGroupPrincipals
- public java.security.Principal[] getGroupPrincipals( )
Gets the principals representing the groups of this subject.
Returns:
the group Principals.
setGroupPrincipals
- public void setGroupPrincipals( java.security.Principal[] prins)
Sets the group principals for this subject.
Parameters:
prins
- The group principals to set. getUserPrincipal
- public java.security.Principal getUserPrincipal( )
Gets the principal representing the user identity for this subject.
Returns:
the user Principal.
setUserPrincipal
- public void setUserPrincipal(java.security.Principal prin)
Sets the principal representing the user identity for this subject.
Parameters:
prin
- The user principal to set. getAuthenticationToken
- public org.w3c.dom.Element getAuthenticationToken( )
This method gets the token used to authenticate.
Returns:
the authentication token.
setAuthenticationToken
- public void setAuthenticationToken( org.w3c.dom.Element token)
This method sets the token used to authenticate this Subject.
Parameters:
token
- To set the authentication token.