You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2007/07/04 17:14:30 UTC
svn commit: r553234 - in /ofbiz/trunk/specialpurpose/oagis:
config/oagis.properties src/org/ofbiz/oagis/OagisShipmentServices.java
Author: jonesde
Date: Wed Jul 4 08:14:28 2007
New Revision: 553234
URL: http://svn.apache.org/viewvc?view=rev&rev=553234
Log:
Added some support for using HTTP Basic Auth for client authentication, instead of the client certificate
Modified:
ofbiz/trunk/specialpurpose/oagis/config/oagis.properties
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
Modified: ofbiz/trunk/specialpurpose/oagis/config/oagis.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/config/oagis.properties?view=diff&rev=553234&r1=553233&r2=553234
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/config/oagis.properties (original)
+++ ofbiz/trunk/specialpurpose/oagis/config/oagis.properties Wed Jul 4 08:14:28 2007
@@ -28,7 +28,9 @@
Oagis.Template.ProcessShipment=component://oagis/widget/MessageInfoScreens.xml#ProcessShipment
# Client Cert, etc settings
-auth.client.certificate.alias=testrpckey
+#auth.client.certificate.alias=testrpckey
+#auth.basic.username=foo
+#auth.basic.password=bar
# URLs for outgoing messages
#url.send.processShipment=https://foo.bar.baz/oagis/control/processShipment
Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=553234&r1=553233&r2=553234
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Wed Jul 4 08:14:28 2007
@@ -81,6 +81,8 @@
public static final String resource = "OagisUiLabels";
public static final String certAlias = UtilProperties.getPropertyValue("oagis.properties", "auth.client.certificate.alias");
+ public static final String basicAuthUsername = UtilProperties.getPropertyValue("oagis.properties", "auth.basic.username");
+ public static final String basicAuthPassword = UtilProperties.getPropertyValue("oagis.properties", "auth.basic.password");
public static Map showShipment(DispatchContext ctx, Map context) {
InputStream in = (InputStream) context.get("inputStream");
@@ -374,7 +376,12 @@
http.setDebug(true);
// needed XML post parameters
- http.setClientCertificateAlias(certAlias);
+ if (UtilValidate.isNotEmpty(certAlias)) {
+ http.setClientCertificateAlias(certAlias);
+ }
+ if (UtilValidate.isNotEmpty(basicAuthUsername)) {
+ http.setBasicAuthInfo(basicAuthUsername, basicAuthPassword);
+ }
http.setContentType("text/xml");
http.setKeepAlive(true);