The WFS 1.0 support used java authentication (it registers a callback so that
the URL connection process will accept user/password details from the
application rather than prompt the user).
Gabriel has recently been working with HTTP client; and I expect he may of used
that for the WFS 1.1 DataStore?
Can I ask you to try connection to your WFS using VERSION=1.0.0? I have tested
this when using GeoServe+Tomcat (with Tomcat providing the security).
--
Jody Garnett
On Thursday, 19 January 2012 at 9:51 PM, DGIS Devels wrote:
> Hi,
>
> we are trying to setting authentification in WFSDataStore, using several
> versions of Geotools (stable 2.7.4 and 8.0).
>
> > > map.put(WFSDataStoreFactory.URL.key, wfsUrl);
> > > map.put(WFSDataStoreFactory.TIMEOUT.key, new Integer(10000));
> > > map.put(WFSDataStoreFactory.ENCODING.key, ENCODING);
> > > map.put(WFSDataStoreFactory.ENCODING.CRS, wfsLayerSource.getSrs());
> > > map.put(WFSDataStoreFactory.USERNAME, "XXX");
> > > map.put(WFSDataStoreFactory.PASSWORD, "XXX");
> > > map.put("WFSDataStoreFactory:WFS_STRATEGY", "geoserver");
> > > factory = new WFSDataStoreFactory();
> > > try {
> > > }
> > > catch (IOException exc) {}
> > > dataStore = (WFSDataStore) DataStoreFinder.getDataStore(map);
> > > fs = dataStore.getFeatureSource(wfsLayerSource.getWfsLayerName());
> >
> >
>
>
>
> but always returns this warning:
>
> > 19-ene-2012 11:42:59 org.geotools.data.DataAccessFinder getDataStore
> > WARNING: Web Feature Server should be used, but could not connect
> > java.io.IOException: Server returned HTTP response code: 401 for URL
>
> Do we need to set any other parameter? What's about "Geoserver Real"
> authentication mode?
>
> Does it work for any geotools version?
>
>
> Thanks!
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
>
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> (mailto:[email protected])
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel