try
{
SSOUser user = null;
bis = new ByteArrayInputStream(request.getBytes());
SAMLRequest authRequest = new SAMLRequest(bis);
SAMLAuthenticationQuery query = (SAMLAuthenticationQuery)authRequest.getQuery();
SAMLSubject subject = query.getSubject();
//get the SAMLNameIdentifier
SAMLNameIdentifier id = subject.getNameIdentifier();
String username = id.getName();