Installing the OAUTH2/OIDC module¶
To install the OIDC module:
-
To obtain the OIDC community module:
- If working with a 2.28.2 nightly build, download the module: sec-oidc
Verify that the version number in the filename corresponds to the version of GeoServer you are running (for example 2.28.2 above).
- Community modules are not yet ready for distribution with GeoServer release.
To compile the OIDC module yourself download the src bundle for your GeoServer version and compile:
And package (from the top level geoserver directory):
2. Place the JARs incd ../.. mvn -f src/community/pom.xml clean install -B -DskipTests -PcommunityRelease,assembly -T2 -faeWEB-INF/lib. 3. Restart GeoServer.
Using with the GeoServer Docker Container¶
This will run GeoServer on port 9999 and install the OIDC module.
docker run -it -9999:8080 \
--env INSTALL_EXTENSIONS=true \
--env STABLE_EXTENSIONS="ysld,h2" \
--env COMMUNITY_EXTENSIONS="sec-oidc-plugin" \
docker.osgeo.org/geoserver:2.28.x
If your OIDC IDP server (i.e. keycloak) is running on localhost, then you should ensure that all requests to the IDP occur using the same hostname (this includes the local user's browser and GeoServer directly connecting to the IDP). If you are running your IDP from a real host, then you do NOT have to do this;
Add this to your
/etc/hosts:In your GeoServer OIDC configuration, use
host.docker.internalinstead oflocalhostAccess GeoServer and Keycloak with http://host.docker.internal:PORT