In this advanced part of the tutorial, we will set up a new enforcement point for a local GeoServer WMS instance.
The GeoServer instance is part of the Jetty WSS/GeoServer bundle you should already have downloaded.
The GeoServer WMS serves basic data of Manhattan, which is part of the demo data delivers with the GeoServer executables.
The Enforcement Point is now listening on http://localhost:8080/wss/httpauth/geoserver_wms for requests using HTTP Basic Authentication.
<PermissionSet name="Local GeoServer WMS Permissions">
<ResourceDomain value="http://localhost:8080/wss/*/geoserver_wms/" />
<ActionDomain value="http://localhost:8080/wss/*/geoserver_wms/" />
<SubjectDomain value="urn:n52:security:subject:role" />
<Permission name="alice_all_geoserver">
<Resource value="layers/*" /> <!-- Any layers -->
<Action value="operations/*" /> <!-- Any operations -->
<Subject value="alice" />
</Permission>
</PermissionSet>
To test the permissions, load the protected service into uDig.
File > New > New Map
> [right-click "Alice's Map"] > Add... > Web Map Server
> [paste URL http://localhost:8080/wss/httpauth/geoserver_wms/] > Next > [log in as alice/alice]
> [select all "Manhattan" layers] > Finish
As you can see, for Alice everything works as if she had loaded the WMS directly.
<User username="bob" password="bob" realname="Bob">
<Role name="bob"/>
<Role name="main"/>
</User>
<!-- Users of role 'bob' can view
GetFeatureInfo only on tiger:poi -->
<Permission name="most_GetMap_GetCaps_geoserver">
<Resource value="layers/tiger%3Atiger_roads" />
<Resource value="layers/tiger%3Apoi" />
<Action value="operations/GetCapabilities" />
<Action value="operations/GetMap" />
<Subject value="bob" />
</Permission>
<Permission name="bob_poi_GetFeatureInfo_geoserver">
<Resource value="layers/tiger%3Apoi" />
<Action value="operations/GetFeatureInfo" />
<Subject value="bob" />
</Permission>
<Subject value="guest" />
<!-- users with role guest can request GetFeatureInfo on Countries only within american continent -->
<Permission name="guest_poi_GetFeatureInfo_obliged_geoserver">
<Resource value="layers/tiger%3Apoi" />
<Action value="operations/GetFeatureInfo" />
<Subject value="guest" />
<Obligation name="obligation:wms:extent:boundingbox">
<Attribute name="srs">EPSG:4326</Attribute>
<Attribute name="box">-74.0130,40.7070,-74.0097,40.7100</Attribute>
</Obligation>
</Permission>