Question: How to create a web policy agent in OpenAM given that the server URL, which OpenAM runs on, has a not fully qualified hostname?
Initial situation: For a Prove of concept (POC), I emulate a server structure using docker. I have an apache webserver as a resource server (docker container), an OpenAM docker container for the access management, and a flask web app running in a third container as the client. I configured OpenAM via the GUI. Sofar my flask app can authenticate, request, and retrieve access tokens using simple requests as specified here. However now I also want to protect the apache resource server. For the start without flask and simply by installing an OpenAM Web Policy Agent on the apache webserver and configuring a web policy agent profile in OpenAM following this official ForgeRock guide.
Problem:
When configuring the agent profile in OpenAM using the GUI the OpenAM container's domain name http://openam:8080/openam
is not accepted as a valid server URL.
If I use instead e.g. http://openam.local:8080/openam
the error does not show.
What I tried so far:
- I added an Nginx container that functions as a reverse proxy and used it to change the container's hostnames to
<container>.local
. Now I can reach the containers e.g. viahttp://openam.local:8080/openam
andhttp://apache.local:8080
. However, when I now access the OpenAM GUI usinghttp://openam.local:8080/openam
, enter the default passwords, and pressCreate Configuration
the configuration fails with the following message: - Unable to solve the problem from (1) I figured that I recall the Nginx setup and instead try to configure the agent profile using the command line - in the hope that the above error
Hostname of server URL is not fully qualified
is restricted to the GUI. For the setup via the command line there existed the easy command./ssoadm create-agent ...
as descript here. Butssoadm
was deprecated in favor ofAmster
and I am unable to figure out how to configure the agent policy usingAmster
.
When using docker as described in the original question you can simply set the hostname of the container using
-h
flag.Example OpeanAM:
Example Apache Web Server:
OpenAM can now be reached via
http://openam.example.com:8080/openam
and the apache server viahttp://example.com
.The OpenAM configuration runs through without an error and when configuring the Web Policy Agent the URL is fully qualified.
Reference and best resource to get started with OpenAM is this Quick-Start-Guide from the OpenAM git repo's wiki.