public class AttributeRequestProcessor extends RequestProcessor {
public ResponseToken process(RequestToken request) throws TrustException {
MessageContext context = MessageContext.getCurrentMessageContext();
SAMLPassiveTokenIssuer issuer = null;
WSHandlerResult handlerResults = null;
WSSecurityEngineResult engineResult = null;
WSUsernameTokenPrincipal principal = null;
Vector<WSSecurityEngineResult> wsResults = null;
ResponseToken reponseToken = null;
Vector<WSHandlerResult> handlerResultsVector = null;
OMElement rstr = null;
try {
if (request.getAttributes() == null || request.getAttributes().trim().length() == 0) {
throw new TrustException("attributesMissing");
}
principal = new WSUsernameTokenPrincipal(request.getUserName(), false);
engineResult = new WSSecurityEngineResult(WSConstants.UT, principal, null, null, null);
wsResults = new Vector<WSSecurityEngineResult>();
wsResults.add(engineResult);
handlerResults = new WSHandlerResult("", wsResults);
handlerResultsVector = new Vector<WSHandlerResult>();
handlerResultsVector.add(handlerResults);
MessageContext.getCurrentMessageContext().setProperty(WSHandlerConstants.RECV_RESULTS,
handlerResultsVector);
MessageContext.getCurrentMessageContext().setProperty(RahasConstants.PASSIVE_STS_RST,
getRST(request.getRealm(), request.getAttributes()));
rahasData = new RahasData(context);
issuer = new SAMLPassiveTokenIssuer();
issuer.setAudienceRestrictionCondition(request.getRealm());
issuer.setConfig(getSAMLTokenIssuerConfig(MessageContext.getCurrentMessageContext()
.getAxisService()));
rstr = issuer.issuePassiveRSTR(rahasData);
reponseToken = new ResponseToken();
reponseToken.setResults(rstr.toStringWithConsume());
} catch (Exception e) {
throw new TrustException("errorWhileProcessingAttributeRequest",e);