@Override public void generateSAMLRequest(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { // Generate the signature Document samlDocument = response.getResultingDocument(); if (samlDocument == null) { logger.trace("No document generated in the handler chain. Cannot generate signature"); return; } this.sign(samlDocument, request, response); }
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { logger.trace("No response document found"); return; } this.sign(responseDocument, request, response); }
@Override public void generateSAMLRequest(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { // Generate the signature Document samlDocument = response.getResultingDocument(); if (samlDocument == null) { logger.trace("No document generated in the handler chain. Cannot generate signature"); return; } this.sign(samlDocument, request, response); }
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { if (trace) { log.trace("handleRequestType:No response document found"); } return; } //Get the Key Pair KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR); this.sign(responseDocument, keypair); }
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { if (trace) { log.trace("handleRequestType:No response document found"); } return; } //Get the Key Pair KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR); this.sign(responseDocument, keypair); }
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { logger.trace("No response document found"); return; } this.sign(responseDocument, request, response); }
@Override public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { logger.trace("No response document found"); return; } this.sign(responseDocument, request, response); }
@Override public void generateSAMLRequest(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { // Generate the signature Document samlDocument = response.getResultingDocument(); if (samlDocument == null) { logger.trace("No document generated in the handler chain. Cannot generate signature"); return; } this.sign(samlDocument, request, response); }
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { logger.trace("No response document found"); return; } this.sign(responseDocument, request, response); }
@Override public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { logger.trace("No response document found"); return; } this.sign(responseDocument, request, response); }
@Override public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { logger.trace("No response document found"); return; } this.sign(responseDocument, request, response); }
@Override public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { if (trace) { log.trace("handleStatusResponseType:No response document found"); } return; } //Get the Key Pair KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR); this.sign(responseDocument, keypair); }
@Override public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { Document responseDocument = response.getResultingDocument(); if (responseDocument == null) { if (trace) { log.trace("handleStatusResponseType:No response document found"); } return; } //Get the Key Pair KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR); this.sign(responseDocument, keypair); }
@Override public void generateSAMLRequest(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { //Generate the signature Document samlDocument = response.getResultingDocument(); if (samlDocument == null && trace) { log.trace("No document generated in the handler chain. Cannot generate signature"); return; } //Get the Key Pair KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR); if (keypair == null) { log.error("Key Pair cannot be found"); throw new ProcessingException(ErrorCodes.NULL_VALUE + "KeyPair not found"); } sign(samlDocument, keypair); }
@Override public void generateSAMLRequest(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { //Generate the signature Document samlDocument = response.getResultingDocument(); if (samlDocument == null && trace) { log.trace("No document generated in the handler chain. Cannot generate signature"); return; } //Get the Key Pair KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR); if (keypair == null) { log.error("Key Pair cannot be found"); throw new ProcessingException(ErrorCodes.NULL_VALUE + "KeyPair not found"); } sign(samlDocument, keypair); }
@Override public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { if (supportsRequest(request) && isEncryptionEnabled()) { Document samlResponseDocument = response.getResultingDocument(); if (samlResponseDocument == null) { throwResponseDocumentOrAssertionNotFound(); } String samlNSPrefix = getSAMLNSPrefix(samlResponseDocument); try { QName encryptedAssertionElementQName = new QName(JBossSAMLURIConstants.ASSERTION_NSURI.get(), JBossSAMLConstants.ENCRYPTED_ASSERTION.get(), samlNSPrefix); byte[] secret = WSTrustUtil.createRandomSecret(128 / 8); SecretKey secretKey = new SecretKeySpec(secret, getAlgorithm()); // encrypt the Assertion element and replace it with a EncryptedAssertion element. XMLEncryptionUtil.encryptElement(new QName(JBossSAMLURIConstants.ASSERTION_NSURI.get(), JBossSAMLConstants.ASSERTION.get(), samlNSPrefix), samlResponseDocument, getSenderPublicKey(request), secretKey, getKeySize(), encryptedAssertionElementQName, true); } catch (Exception e) { throw logger.processingError(e); } } // proceed with the signing process. super.handleRequestType(request, response); }
@Override public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { if (supportsRequest(request) && isEncryptionEnabled()) { Document samlResponseDocument = response.getResultingDocument(); if (samlResponseDocument == null) { throwResponseDocumentOrAssertionNotFound(); } String samlNSPrefix = getSAMLNSPrefix(samlResponseDocument); try { QName encryptedAssertionElementQName = new QName(JBossSAMLURIConstants.ASSERTION_NSURI.get(), JBossSAMLConstants.ENCRYPTED_ASSERTION.get(), samlNSPrefix); byte[] secret = WSTrustUtil.createRandomSecret(128 / 8); SecretKey secretKey = new SecretKeySpec(secret, getAlgorithm()); PublicKey publicKey = getSenderPublicKey(request); // encrypt the Assertion element and replace it with a EncryptedAssertion element. XMLEncryptionUtil.encryptElement(new QName(JBossSAMLURIConstants.ASSERTION_NSURI.get(), JBossSAMLConstants.ASSERTION.get(), samlNSPrefix), samlResponseDocument, publicKey, secretKey, getKeySize(), encryptedAssertionElementQName, true); } catch (Exception e) { throw logger.processingError(e); } } // proceed with the signing process. super.handleRequestType(request, response); }
@Override public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { if (supportsRequest(request) && isEncryptionEnabled()) { Document samlResponseDocument = response.getResultingDocument(); if (samlResponseDocument == null) { throwResponseDocumentOrAssertionNotFound(); } String samlNSPrefix = getSAMLNSPrefix(samlResponseDocument); try { QName encryptedAssertionElementQName = new QName(JBossSAMLURIConstants.ASSERTION_NSURI.get(), JBossSAMLConstants.ENCRYPTED_ASSERTION.get(), samlNSPrefix); byte[] secret = WSTrustUtil.createRandomSecret(128 / 8); SecretKey secretKey = new SecretKeySpec(secret, getAlgorithm()); PublicKey publicKey = getSenderPublicKey(request); // encrypt the Assertion element and replace it with a EncryptedAssertion element. XMLEncryptionUtil.encryptElement(new QName(JBossSAMLURIConstants.ASSERTION_NSURI.get(), JBossSAMLConstants.ASSERTION.get(), samlNSPrefix), samlResponseDocument, publicKey, secretKey, getKeySize(), encryptedAssertionElementQName, true); } catch (Exception e) { throw logger.processingError(e); } } // proceed with the signing process. super.handleRequestType(request, response); }
Document samlResponseDocument = saml2HandlerResponse.getResultingDocument(); String relayState = saml2HandlerResponse.getRelayState();
Document samlResponseDocument = saml2HandlerResponse.getResultingDocument(); String relayState = saml2HandlerResponse.getRelayState();