1 year ago

#342974

test-img

Srinath Menon

DNS issue when connecting to PingFederate docker running on Docker Desktop

I am running PingFederate v11.0.1 (https://devops.pingidentity.com/docker-images/pingfederate/) docker image on Docker Desktop which is hosted on a Mac laptop. The docker image is started with -publish parameter and exposing ports 9999 and 9031 respectively.

The UI for PingFed is launching successfully from the host machine browser and after setting up the OAuth configuration, testing it for flow brings weird issue where in the DNS is not able to resolve the localhost of the container for the port 9031.

Error seen is as follows:

Request / Response

POST /as/token.oauth2 HTTP/1.1
Host: localhost:9031
Content-length: 248
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground

code=pwTpsz1uouFBV4DCTyC-Vyf\_-vJy7bVKGyL4wmnJ&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground&client_id=snowflake&client_secret=fxBieuR64XUWaVoELQQ36M1TJvu8MrJlI1boc58hbbryu5YDsB6QolXxcn56yz73&scope=&grant_type=authorization_code

HTTP/1.1 400 Bad Request
Content-length: 114
Content-type: text/plain

An error occured while connecting to the server: DNS lookup failed for URL: https://localhost:9031/as/token.oauth2%60

I am not able to figure out what exactly is the configuration that is blocking the access to the container and port.

Some additional tests done from the host machine and results are as follows:

1.

nc -v -z -w2 pingfederate 9031

Connection to pingfederate port 9031 \[tcp/\*\] succeeded
  1. docker port pingfederate

    9031/tcp -> 0.0.0.0:9031 9999/tcp -> 0.0.0.0:9999

  2. Testing with curl command too brings up blank response:

    curl -X POST -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" \ --user <client_id>:<client_secret> \ --data-urlencode "username=" \ --data-urlencode "password=" \ --data-urlencode "grant_type=authorization_code" \ --data-urlencode "code=XXKRwlZ04vyWDKhWHIPtYJYrirgYsa-qYuVeGKIy" \ --data-urlencode "scope=session:role:" \ 'https://localhost:9031/as/token.oauth2' -insecure

Have set the following in the /etc/hosts file of the host machine:

127.0.0.1 pingfederate

docker

docker-desktop

pingfederate

0 Answers

Your Answer

Accepted video resources