- /**
- * This builds the response for this SAML request.
- *
- * @param responseContext <code>ProfileResponseContext</code>
- * @return <code>Response</code>
- * @throws EncryptionException if an error occurs attempting to encrypt data
- */
- protected Response buildResponse(ProfileResponseContext responseContext) throws EncryptionException {
- AttributeQueryConfiguration config = getAttributeQueryConfiguration(responseContext.getProviderId());
-
- /*
- * required: samlp:Status, ID, Version, IssueInstant
- */
- Response response = responseBuilder.buildObject();
- response.setVersion(SAML_VERSION);
- response.setID(getIdGenerator().generateIdentifier());
- response.setInResponseTo(responseContext.getIssuer());
- response.setIssueInstant(responseContext.getIssueInstant());
- response.setDestination(responseContext.getDestination());
-
- response.setIssuer(buildIssuer(responseContext));
-
- /*
- * Will be hard coded in the future: if (consent != null) { response.setConsent(consent); }
- *
- */
-
- /*
- * No extensions currently exist, will be hardcorded in the future: if (extensions != null) {
- * response.setExtensions(extensions); }
- *
- */
-
- if (config.getSignAssertions()) {
- Signature s = buildSignature();
- s.setSigningKey(config.getSigningCredential().getPrivateKey());
- if (config.getEncryptAssertion()) {
- // TODO load encryption parameters
- Encrypter encrypter = null;
- Assertion a = buildAssertion(responseContext);
- a.setSignature(s);
- Signer.signObject(s);
- response.getEncryptedAssertions().add(encrypter.encrypt(a));
- } else {
- Assertion a = buildAssertion(responseContext);
- a.setSignature(s);
- Signer.signObject(s);
- response.getAssertions().add(a);
- }
- } else {
- if (config.getEncryptAssertion()) {
- // TODO load encryption parameters
- Encrypter encrypter = null;
- response.getEncryptedAssertions().add(encrypter.encrypt(buildAssertion(responseContext)));
- } else {
- response.getAssertions().add(buildAssertion(responseContext));
+ /** {@inheritDoc} */
+ public void processRequest(ProfileRequest<ServletRequest> request, ProfileResponse<ServletResponse> response)
+ throws ProfileException {
+ MessageDecoder<ServletRequest> decoder = getMessageDecoder(request);
+ populateMessageDecoder(decoder);
+ decoder.setRequest(request.getRawRequest());
+
+ // get message from the decoder
+ AttributeQuery attributeQuery = null;
+ try {
+ decoder.decode();
+ if (log.isDebugEnabled()) {
+ log.debug("decoded http servlet request");