}
@Override
protected Group[] getRoleSets() throws LoginException {
// Get the SAML Assertion
SamlCredential samlCredential = null;
Set<Object> creds = subject.getPublicCredentials();
for (Object cred : creds) {
if (cred instanceof SamlCredential) {
samlCredential = (SamlCredential) cred;
break;
}
}
if (samlCredential == null)
throw logger.authSAMLCredentialNotAvailable();
try {
String assertionStr = samlCredential.getAssertionAsString();
if (StringUtil.isNullOrEmpty(assertionStr))
throw logger.authSAMLAssertionNullOrEmpty();
SAMLParser parser = new SAMLParser();
AssertionType assertion = (AssertionType) parser.parse(new ByteArrayInputStream(assertionStr.getBytes()));