AssertionType assertion = responseType.getAssertions().get(0).getAssertion();
private ResponseType decryptAssertion(ResponseType responseType, PrivateKey privateKey) throws ProcessingException { if (privateKey == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "privateKey"); SAML2Response saml2Response = new SAML2Response(); try { Document doc = saml2Response.convert(responseType); Element enc = DocumentUtil.getElement(doc, new QName(JBossSAMLConstants.ENCRYPTED_ASSERTION.get())); if (enc == null) throw new ProcessingException(ErrorCodes.NULL_VALUE + "Null encrypted assertion element"); String oldID = enc.getAttribute(JBossSAMLConstants.ID.get()); Document newDoc = DocumentUtil.createDocument(); Node importedNode = newDoc.importNode(enc, true); newDoc.appendChild(importedNode); Element decryptedDocumentElement = XMLEncryptionUtil.decryptElementInDocument(newDoc, privateKey); SAMLParser parser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(decryptedDocumentElement); AssertionType assertion = (AssertionType) parser.parse(StaxParserUtil.getXMLEventReader(DocumentUtil .getNodeAsStream(decryptedDocumentElement))); responseType.replaceAssertion(oldID, new RTChoiceType(assertion)); return responseType; } catch (Exception e) { throw new ProcessingException(e); } }
Object assertion = assertions.get(0).getEncryptedAssertion(); if (assertion instanceof EncryptedAssertionType) { responseType = this.decryptAssertion(responseType, privateKey); assertion = responseType.getAssertions().get(0).getAssertion(); assertion = assertions.get(0).getAssertion();
AssertionType assertion = responseType.getAssertions().get(0).getAssertion();
AssertionType assertion = responseType.getAssertions().get(0).getAssertion();
AssertionType assertion = responseType.getAssertions().get(0).getAssertion();
AssertionType at = responseType.getAssertions().get(0).getAssertion(); XACMLAuthzDecisionStatementType xst = (XACMLAuthzDecisionStatementType) at.getStatements().iterator().next(); ResultType rt = xst.getResponse().getResult().get(0);
throw new IllegalStateException(ErrorCodes.NULL_VALUE + "No assertions in reply from IDP"); AssertionType assertion = assertions.get(0).getAssertion();
throw new IllegalStateException(ErrorCodes.NULL_VALUE + "No assertions in reply from IDP"); AssertionType assertion = assertions.get(0).getAssertion();
throw logger.samlHandlerNoAssertionFromIDP(); AssertionType assertion = assertions.get(0).getAssertion();
AssertionType assertion = responseType.getAssertions().get(0).getAssertion();
throw logger.samlHandlerNoAssertionFromIDP(); AssertionType assertion = assertions.get(0).getAssertion();
AssertionType at = responseType.getAssertions().get(0).getAssertion(); XACMLAuthzDecisionStatementType xst = (XACMLAuthzDecisionStatementType) at.getStatements().iterator().next(); ResultType rt = xst.getResponse().getResult().get(0);
throw new IllegalStateException(ErrorCodes.NULL_VALUE + "No assertions in reply from IDP"); AssertionType assertion = assertions.get(0).getAssertion();
AssertionType at = responseType.getAssertions().get(0).getAssertion(); XACMLAuthzDecisionStatementType xst = (XACMLAuthzDecisionStatementType) at.getStatements().iterator().next(); ResultType rt = xst.getResponse().getResult().get(0);
throw new IllegalStateException(ErrorCodes.NULL_VALUE + "No assertions in reply from IDP"); AssertionType assertion = assertions.get(0).getAssertion();
throw logger.samlHandlerNoAssertionFromIDP(); AssertionType assertion = assertions.get(0).getAssertion();
AssertionType at = responseType.getAssertions().get(0).getAssertion(); XACMLAuthzDecisionStatementType xst = (XACMLAuthzDecisionStatementType) at.getStatements().iterator().next(); ResultType rt = xst.getResponse().getResult().get(0);
throw new IllegalStateException(ErrorCodes.NULL_VALUE + "No assertions in reply from IDP"); AssertionType assertion = assertions.get(0).getAssertion();
throw new IllegalStateException(ErrorCodes.NULL_VALUE + "No assertions in reply from IDP"); //$NON-NLS-1$ AssertionType assertion = assertions.get(0).getAssertion();