diff options
Diffstat (limited to 'id')
5 files changed, 64 insertions, 18 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index d0cd05482..8aef6af2d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -121,6 +121,7 @@ public class PEPSConnectorServlet extends AuthServlet { try {
AuthConfigurationProvider authConfigurationProvider = AuthConfigurationProvider.getInstance();
dtlUrl = authConfigurationProvider.getDocumentServiceUrl();
+ Logger.info ("PEPSConnectorServlet, using dtlUrl:"+dtlUrl);
} catch (Exception e) {
dtlUrl = "http://testvidp.buergerkarte.at/DocumentService/DocumentService";
e.printStackTrace();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java index 501e33a75..bb3d8b1fd 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java @@ -56,6 +56,7 @@ import org.apache.velocity.app.VelocityEngine; import org.bouncycastle.util.encoders.UrlBase64; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.protocols.stork2.ExternalAttributeRequestRequiredException; @@ -108,15 +109,25 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { super(attributes); this.oasisDssWebFormURL = oasisDssWebFormURL; - Properties props = new Properties(); try { - props.load(DatabaseConnectorMySQLImpl.class.getResourceAsStream("docservice.properties")); - dtlUrl = props.getProperty("docservice.url"); - } catch (IOException e) { + AuthConfigurationProvider authConfigurationProvider = AuthConfigurationProvider.getInstance(); + dtlUrl = authConfigurationProvider.getDocumentServiceUrl(); + Logger.info ("SignedDocAttributeRequestProvider, using dtlUrl:"+dtlUrl); + } catch (Exception e) { dtlUrl = "http://testvidp.buergerkarte.at/DocumentService/DocumentService"; - Logger.error("Loading DTL config failed, using default value:"+dtlUrl); e.printStackTrace(); - } + Logger.error("Loading documentservice url failed, using default value:"+dtlUrl); + } + +// Properties props = new Properties(); +// try { +// props.load(DatabaseConnectorMySQLImpl.class.getResourceAsStream("docservice.properties")); +// dtlUrl = props.getProperty("docservice.url"); +// } catch (IOException e) { +// dtlUrl = "http://testvidp.buergerkarte.at/DocumentService/DocumentService"; +// Logger.error("Loading DTL config failed, using default value:"+dtlUrl); +// e.printStackTrace(); +// } } /* @@ -208,7 +219,16 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { // set the url in the SignResponse DocumentWithSignature documentWithSignature = new DocumentWithSignature(); DocumentType value = new DocumentType(); - value.setDocumentURL(dtlUrl); + if(dtlUrl.endsWith("?wsdl")) + { + String tmp = dtlUrl.replace("?wsdl", ""); + Logger.debug("DocumentUrl ends with ? wsdl, using "+tmp+" instead."); + value.setDocumentURL(tmp); + } + else + { + value.setDocumentURL(dtlUrl); + } documentWithSignature.setDocument(value); if(signResponse.getOptionalOutputs()!=null) { @@ -356,7 +376,13 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { byte[] data = getDocumentFromDtl(docRequest, dtlURL);//dtlUrl //load doc from DTL - Logger.debug("data:"+data); + Logger.debug("data:"+data+" "+data.length); + try{ + Logger.trace("data:"+new String(data,"UTF-8")); + }catch(Exception e) + { + Logger.trace("data: creating String failed:"+e); + } String mime = getDocumentMimeFromDtl(docId, dtlURL);//dtlUrl Logger.debug("mime:"+mime); @@ -367,11 +393,28 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { IncludeObject.class); signRequest.getOptionalInputs().getAny().removeAll(includeObjects); + String documentId = null; + Object objDoc = signRequest.getInputDocuments().getDocumentOrTransformedDataOrDocumentHash().get(0); + if (objDoc != null && objDoc instanceof DocumentType) + { + DocumentType document = (DocumentType)objDoc; + documentId = document.getID(); + } DocumentType document = new DocumentType(); - Base64Data b64data = new Base64Data(); - b64data.setValue(data); - b64data.setMimeType(mime); - document.setBase64Data(b64data); + if(documentId != null) + document.setID(documentId); + if(signRequest.getProfile().toLowerCase().contains("xades")) + { + document.setBase64XML(data); + } + else + { + Base64Data b64data = new Base64Data(); + b64data.setValue(data); + b64data.setMimeType(mime); + document.setBase64Data(b64data); + } + signRequest.setInputDocuments(ApiUtils.createInputDocuments(document)); //override old signRequestString @@ -380,6 +423,7 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { IOUtils.copy(istr, writer, "UTF-8"); signRequestString = writer.toString(); Logger.info("Signrequest overwritten"); + Logger.debug("Signrequest overwritten:"+signRequestString); } catch (Exception e) { e.printStackTrace(); throw new Exception("Could not marshall sign request", e); @@ -470,6 +514,7 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { URL url = null; try { + Logger.debug("getDocumentFromDtl:"+dtlUrl); url = new URL(dtlUrl); QName qname = new QName("http://stork.eu", "DocumentService"); diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java index 991682c9b..9a0f87488 100644 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java @@ -54,13 +54,13 @@ public final class PersonalAttributeList extends /** * Hash with the latest fetched attribute name alias. */ - private final transient Map<String, Integer> latestAttrAlias = + private final Map<String, Integer> latestAttrAlias = new HashMap<String, Integer>(); /** * Hash with mapping number of alias or the attribute name. */ - private final transient Map<String, Integer> attrAliasNumber = + private final Map<String, Integer> attrAliasNumber = new HashMap<String, Integer>(); /** diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java index 1974f4f66..276b26a03 100644 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java @@ -38,7 +38,7 @@ public class STORKAttrQueryResponse implements Serializable { private String subStatusCode;
/** Audience restriction. */
- private transient String audienceRest;
+ private String audienceRest;
/** Error message. */
private String message;
@@ -65,7 +65,7 @@ public class STORKAttrQueryResponse implements Serializable { private List<Assertion> assertions;
/** The complete list from all assertions **/
- private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+ private IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
/** All personal attribute lists **/
private List<IPersonalAttributeList> attributeLists;
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java index c4a3e2b6c..62a5343ec 100644 --- a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java @@ -47,7 +47,7 @@ public final class STORKAuthnResponse implements Serializable { private String subStatusCode; /** Audience restriction. */ - private transient String audienceRest; + private String audienceRest; /** Error message. */ private String message; @@ -74,7 +74,7 @@ public final class STORKAuthnResponse implements Serializable { private List<Assertion> assertions; /** The complete list from all assertions **/ - private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList(); + private IPersonalAttributeList totalAttributeList = new PersonalAttributeList(); /** All personal attribute lists **/ private List<IPersonalAttributeList> attributeLists; |