GeoServer

Cascading WMS: Add authentication support for a remote wms store

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.1.3
  • Component/s: WMS
  • Labels:
    None
  • Number of attachments :
    1

Description

Authentication for a remote wms isn't now supported. Could it be added?

Issue Links

Activity

Hide
Andrea Aime added a comment -

It can be done but the library used to make the WMS requests does not make it easy. Would require some time to implement, with changes in both geotools and geoserver.
If you are interested in doing it yourself ask on the devel list for directions.

Show
Andrea Aime added a comment - It can be done but the library used to make the WMS requests does not make it easy. Would require some time to implement, with changes in both geotools and geoserver. If you are interested in doing it yourself ask on the devel list for directions.
Hide
Anders Erlandsson added a comment -

I am also highly interrested in the cascade functionality with authetication, but has no funding nor experience in developing Java.

Show
Anders Erlandsson added a comment - I am also highly interrested in the cascade functionality with authetication, but has no funding nor experience in developing Java.
Hide
Gabriel Roldán added a comment -

I've a mandate now to get cascaded WMS layers working with basic authentication.
Do you mind if I take ownership of this issue?

A cursory look at the involved classes seem to suggest overloading the geotools WebMapServer constructor to receive the auth credentials and storing them as part of WMSStoreInfo would do the trick. Is there anything else to take into account?

Show
Gabriel Roldán added a comment - I've a mandate now to get cascaded WMS layers working with basic authentication. Do you mind if I take ownership of this issue? A cursory look at the involved classes seem to suggest overloading the geotools WebMapServer constructor to receive the auth credentials and storing them as part of WMSStoreInfo would do the trick. Is there anything else to take into account?
Hide
Andrea Aime added a comment -

Gabriel, I don't mind at all, thanks for taking this on.
I think the basic approach you're suggesting will do.
The annoying part is, I guess, to modify AbstractOpenWebService to receive and use the username/password and do yourself the basic auth. If you don't want to introduce a dependency to commons-codec we should have a working Base64 class in the PostGIS store.
And then handle the eventual failure codes, and the GUI, use the metadata fields in the info objects if you need this on the stable series, testing, yada yada yada (will take its dear time...).

Ah btw, one approach that we discussed that could work for the info metadata fields is to use just metadata in 2.1.x, but expose setters and getters as a normal field, and have the proper fields with backwards compatible metadata lookup on trunk

Show
Andrea Aime added a comment - Gabriel, I don't mind at all, thanks for taking this on. I think the basic approach you're suggesting will do. The annoying part is, I guess, to modify AbstractOpenWebService to receive and use the username/password and do yourself the basic auth. If you don't want to introduce a dependency to commons-codec we should have a working Base64 class in the PostGIS store. And then handle the eventual failure codes, and the GUI, use the metadata fields in the info objects if you need this on the stable series, testing, yada yada yada (will take its dear time...). Ah btw, one approach that we discussed that could work for the info metadata fields is to use just metadata in 2.1.x, but expose setters and getters as a normal field, and have the proper fields with backwards compatible metadata lookup on trunk
Hide
Gabriel Roldán added a comment -

Thanks Andrea.
I wouldn't actually mind introducing a commons-http-client dependency as well. Let me get into the code and see how hard that would be.

Agreed on the info metadata approach.

Show
Gabriel Roldán added a comment - Thanks Andrea. I wouldn't actually mind introducing a commons-http-client dependency as well. Let me get into the code and see how hard that would be. Agreed on the info metadata approach.
Hide
Andrea Aime added a comment -

About commons-http, I would not mind either. Mind, all the existing code uses commons-httpclient 3.x

Show
Andrea Aime added a comment - About commons-http, I would not mind either. Mind, all the existing code uses commons-httpclient 3.x
Hide
Gabriel Roldán added a comment -

the attached patch accompanies the one at GEOT-3860 and enables a wms store to set up auth credentials and max number of concurrent connections to the cascaded WMS.

Andrea if you have a chance to review I'd welcome your comments before committing.

Note when back porting to 2.1.x I'll get rid of the new WMSStoreInfoImpl properties and use the metadata map instead.

Show
Gabriel Roldán added a comment - the attached patch accompanies the one at GEOT-3860 and enables a wms store to set up auth credentials and max number of concurrent connections to the cascaded WMS. Andrea if you have a chance to review I'd welcome your comments before committing. Note when back porting to 2.1.x I'll get rid of the new WMSStoreInfoImpl properties and use the metadata map instead.
Hide
Gabriel Roldán added a comment -

patch is ready to be committed but svn is hanging out for commits right now.
Patch for the related geotools issue (GEOT-3860) has already been committed.

Show
Gabriel Roldán added a comment - patch is ready to be committed but svn is hanging out for commits right now. Patch for the related geotools issue (GEOT-3860) has already been committed.
Hide
Gabriel Roldán added a comment -

fixed at r16396 on 2.1.x and r16394 on trunk

Show
Gabriel Roldán added a comment - fixed at r16396 on 2.1.x and r16394 on trunk
Hide
Gabriel Roldán added a comment -

wms store docs updated at r16397/r16398.

Show
Gabriel Roldán added a comment - wms store docs updated at r16397/r16398.
Hide
Gabriel Roldán added a comment -

Update: extra patch for the URL validator in the new WMS store page to pass on the auth credentials in case the GetCapabilities operation is protected, at r16425 on 2.1.x and r16424 on 2.1.x

Show
Gabriel Roldán added a comment - Update: extra patch for the URL validator in the new WMS store page to pass on the auth credentials in case the GetCapabilities operation is protected, at r16425 on 2.1.x and r16424 on 2.1.x

People

Vote (1)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: