[jboss-user] [JCA Development] - JcaXAResourceRecovery

ANIL SALDHANA do-not-reply at jboss.com
Mon Apr 19 13:29:52 EDT 2010


ANIL SALDHANA [http://community.jboss.org/people/anil.saldhana%40jboss.com] replied to the discussion

"JcaXAResourceRecovery"

To view the discussion, visit: http://community.jboss.org/message/538352#538352

--------------------------------------------------------------
Once you have the SubjectFactory installed and you know what the username/cred combo, is,  what needs to be done before you do getSubject() is the following:

AccessController.doPrivileged( new PrivilegedAction()
{
  public Object run()
  {
     //Create a security context on the association
     SecurityContext securityContext = SecurityContextFactory.createSecurityContext(securityDomainName);
     SecurityContextAssociation.setSecurityContext(securityContext);
 
     //Now let us add the user name and cred
     securityContext.getSubjectInfo().setPrincipal( principal );
     securityContext.getSubjectInfo().setCredential( credential );
 
};


The implementation of SubjectFactory basically looks for the username/cred in the current security context on the SecurityContextAssociation.

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/538352#538352]

Start a new discussion in JCA Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2099]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100419/dc5add30/attachment.html 


More information about the jboss-user mailing list