Ciao,
Quoting Todd Allen <[EMAIL PROTECTED]>:
This link may help:
http://wso2.org/library/169
This might be outdated. Try this code:
Vector results = null;
String username = null;
if ((results = (Vector) inMsgCtx
.getProperty(WSHandlerConstants.RECV_RESULTS)) == null)
throw new RuntimeException("No security results!!");
else {
for (int i = 0; i < results.size(); i++) {
// Get hold of the WSHandlerResult instance
WSHandlerResult rResult = (WSHandlerResult)
results.get(i);
Vector wsSecEngineResults =
rResult.getResults();
for (int j = 0; j < wsSecEngineResults.size();
j++) {
// Get hold of the
WSSecurityEngineResult instance
WSSecurityEngineResult wser = (WSSecurityEngineResult)
wsSecEngineResults.get(j);
// Extract the principal
Collection values = wser.values();
Iterator valuesIt = values.iterator();
while (valuesIt.hasNext()) {
Object o = valuesIt.next();
if (o instanceof
WSUsernameTokenPrincipal) {
WSUsernameTokenPrincipal principal = (WSUsernameTokenPrincipal) o;
username =
principal.getName();
}
// Todo: to see if it is
instance of kerberos token
// etc.
}
}
}
}
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]