summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_pvp2_idp
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2018-07-20 10:57:08 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2018-07-20 10:57:08 +0200
commit84a86ceddf89f4a1a04396a37742a892f09ffafb (patch)
tree8408d00bb975a6cf5cae551018ca93ea4bf2b1a8 /eaaf_modules/eaaf_module_pvp2_idp
parent41ee559d1aafc2eab6f4f9a339ff8b6ca9970c18 (diff)
downloadEAAF-Components-84a86ceddf89f4a1a04396a37742a892f09ffafb.tar.gz
EAAF-Components-84a86ceddf89f4a1a04396a37742a892f09ffafb.tar.bz2
EAAF-Components-84a86ceddf89f4a1a04396a37742a892f09ffafb.zip
some small modifications in attribute builder
update internal messages-codes
Diffstat (limited to 'eaaf_modules/eaaf_module_pvp2_idp')
-rw-r--r--eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/exception/InvalidAssertionConsumerServiceException.java2
-rw-r--r--eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/AbstractPVP2XProtocol.java15
-rw-r--r--eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/MetadataAction.java2
-rw-r--r--eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/PVPSProfilePendingRequest.java58
-rw-r--r--eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/PVP2AssertionBuilder.java3
5 files changed, 13 insertions, 67 deletions
diff --git a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/exception/InvalidAssertionConsumerServiceException.java b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/exception/InvalidAssertionConsumerServiceException.java
index 38daf6bf..07e7d99e 100644
--- a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/exception/InvalidAssertionConsumerServiceException.java
+++ b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/exception/InvalidAssertionConsumerServiceException.java
@@ -33,7 +33,7 @@ import at.gv.egiz.eaaf.modules.pvp2.exception.PVP2Exception;
public class InvalidAssertionConsumerServiceException extends PVP2Exception {
public InvalidAssertionConsumerServiceException(int idx) {
- super("pvp2.00", new Object[]{idx});
+ super("pvp2.28", new Object[]{idx});
this.statusCodeValue = StatusCode.REQUESTER_URI;
}
diff --git a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/AbstractPVP2XProtocol.java b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/AbstractPVP2XProtocol.java
index 7a363455..93264804 100644
--- a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/AbstractPVP2XProtocol.java
+++ b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/AbstractPVP2XProtocol.java
@@ -400,8 +400,9 @@ public abstract class AbstractPVP2XProtocol extends AbstractAuthProtocolModulCon
log.debug("Find protocol handler in child implementation");
else {
- log.error("Receive unsupported PVP21 message");
- throw new InvalidPVPRequestException("Unsupported PVP21 message", new Object[] {});
+ log.error("Receive unsupported PVP21 message of type: " + ((PVPSProfileRequest)msg).getSamlRequest().getClass().getName());
+ throw new InvalidPVPRequestException("pvp2.09",
+ new Object[] {((PVPSProfileRequest)msg).getSamlRequest().getClass().getName()});
}
revisionsLogger.logEvent(pendingReq, IRevisionLogger.AUTHPROTOCOL_TYPE, getAuthProtocolIdentifier());
@@ -438,15 +439,17 @@ public abstract class AbstractPVP2XProtocol extends AbstractAuthProtocolModulCon
if (authnRequest.getIssueInstant() == null) {
log.warn("Unsupported request: No IssueInstant Attribute found.");
- throw new AuthnRequestValidatorException("Unsupported request: No IssueInstant Attribute found.", new Object[] {},
- "Unsupported request: No IssueInstant Attribute found", pendingReq);
+ throw new AuthnRequestValidatorException("pvp2.22",
+ new Object[] {"Unsupported request: No IssueInstant Attribute found"},
+ pendingReq);
}
if (authnRequest.getIssueInstant().minusMinutes(EAAFConstants.ALLOWED_TIME_JITTER).isAfterNow()) {
log.warn("Unsupported request: No IssueInstant DateTime is not valid anymore.");
- throw new AuthnRequestValidatorException("Unsupported request: No IssueInstant DateTime is not valid anymore.", new Object[] {},
- "Unsupported request: No IssueInstant DateTime is not valid anymore.", pendingReq);
+ throw new AuthnRequestValidatorException("pvp2.22",
+ new Object[] {"Unsupported request: No IssueInstant DateTime is not valid anymore."},
+ pendingReq);
}
diff --git a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/MetadataAction.java b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/MetadataAction.java
index 1baded12..b15b4fbf 100644
--- a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/MetadataAction.java
+++ b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/MetadataAction.java
@@ -93,7 +93,7 @@ public class MetadataAction implements IAction {
} catch (Exception e) {
log.error("Failed to generate metadata", e);
- throw new PVP2MetadataException("pvp2.13", null);
+ throw new PVP2MetadataException("pvp2.27", null);
}
}
diff --git a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/PVPSProfilePendingRequest.java b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/PVPSProfilePendingRequest.java
index 0d53f471..e7c5bab9 100644
--- a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/PVPSProfilePendingRequest.java
+++ b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/PVPSProfilePendingRequest.java
@@ -66,62 +66,4 @@ public class PVPSProfilePendingRequest extends RequestImpl {
this.consumerURL = consumerURL;
}
-
-// /* (non-Javadoc)
-// * @see at.gv.egovernment.moa.id.moduls.RequestImpl#getRequestedAttributes()
-// */
-// @Override
-// public Collection<String> getRequestedAttributes(MetadataProvider metadataProvider) {
-//
-// Map<String, String> reqAttr = new HashMap<String, String>();
-// for (String el : PVP2XProtocol.DEFAULTREQUESTEDATTRFORINTERFEDERATION)
-// reqAttr.put(el, "");
-//
-// try {
-// SPSSODescriptor spSSODescriptor = getRequest().getEntityMetadata(metadataProvider).getSPSSODescriptor(SAMLConstants.SAML20P_NS);
-// if (spSSODescriptor.getAttributeConsumingServices() != null &&
-// spSSODescriptor.getAttributeConsumingServices().size() > 0) {
-//
-// Integer aIdx = null;
-// if (getRequest() instanceof MOARequest &&
-// ((MOARequest)getRequest()).getSamlRequest() instanceof AuthnRequestImpl) {
-// AuthnRequestImpl authnRequest = (AuthnRequestImpl)((MOARequest)getRequest()).getSamlRequest();
-// aIdx = authnRequest.getAttributeConsumingServiceIndex();
-//
-// } else {
-// Logger.error("MOARequest is NOT of type AuthnRequest");
-// }
-//
-// int idx = 0;
-//
-// AttributeConsumingService attributeConsumingService = null;
-//
-// if (aIdx != null) {
-// idx = aIdx.intValue();
-// attributeConsumingService = spSSODescriptor
-// .getAttributeConsumingServices().get(idx);
-//
-// } else {
-// List<AttributeConsumingService> attrConsumingServiceList = spSSODescriptor.getAttributeConsumingServices();
-// for (AttributeConsumingService el : attrConsumingServiceList) {
-// if (el.isDefault())
-// attributeConsumingService = el;
-// }
-// }
-//
-// for ( RequestedAttribute attr : attributeConsumingService.getRequestAttributes())
-// reqAttr.put(attr.getName(), "");
-// }
-//
-// //return attributQueryBuilder.buildSAML2AttributeList(this.getOnlineApplicationConfiguration(), reqAttr.keySet().iterator());
-// return reqAttr.keySet();
-//
-// } catch (NoMetadataInformationException e) {
-// Logger.warn("NO metadata found for Entity " + getRequest().getEntityID());
-// return null;
-//
-// }
-//
-// }
-
}
diff --git a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/PVP2AssertionBuilder.java b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/PVP2AssertionBuilder.java
index d049aeb3..f50a4495 100644
--- a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/PVP2AssertionBuilder.java
+++ b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/PVP2AssertionBuilder.java
@@ -332,7 +332,8 @@ public class PVP2AssertionBuilder implements PVPConstants {
} catch (Exception e) {
log.warn("PVP2 subjectNameID error", e);
- throw new ResponderErrorException("pvp2.13", null, e);
+ throw new ResponderErrorException("internal.03", null, e);
+
}
} else