nicolabeghin / keycloak-spid-provider-configuration-client

A configuration client for a keycloak installation patched with the spid provider plugin
6 stars 4 forks source link

Error building the Docker image #1

Closed pibragh closed 1 year ago

pibragh commented 1 year ago

I am trying to build the docker image but the build process fails with the following error:

~/git/keycloak-spid-provider-configuration-client$ sudo docker build - < Dockerfile
Sending build context to Docker daemon  2.048kB
Step 1/10 : FROM node:lts
 ---> c8907212ebaa
Step 2/10 : ENV NODE_ENV=production
 ---> Using cache
 ---> c7fef0246859
Step 3/10 : WORKDIR /usr/src/app
 ---> Using cache
 ---> f86c3fc750b4
Step 4/10 : COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", ".env", "./"]
COPY failed: stat /var/lib/docker/tmp/docker-builder198298932/package.json: no such file or directory
nicolabeghin commented 1 year ago

The way you're invoking the Docker build does not seem ok to me - just pushed a9bb29806ceb8545d747ea181a68666098c83a18 to simplify consumption through Docker - just pull then make from source root.

pibragh commented 1 year ago

I followed your instructions by using make but I got that error: Immagine 2023-03-03 102422

Taking a look to the master realm endpoint, I read the following: Immagine 2023-03-03 103102

the token endpoint url seems to be different (I am using keycloak 21.0.1)

nicolabeghin commented 1 year ago

The assumption is that Keycloak is exposed on /auth path (as it was in previous Keycloak versions). You can change this in https://github.com/nicolabeghin/keycloak-spid-provider-configuration-client/blob/master/src/http.js#L32

from

url: config.keycloakServerBaseURL + '/auth/realms/' + config.adminRealm + '/protocol/openid-connect/token',

to

url: config.keycloakServerBaseURL + '/realms/' + config.adminRealm + '/protocol/openid-connect/token',

I will try to make this parametric in the configuration but at least you can progress.

pibragh commented 1 year ago

Perfect. I made the changes and now everything seems to be fine. I noticed an issue regarding the mapping of the address field: Immagine 2023-03-03 115246

nicolabeghin commented 1 year ago

Submitted fix in df0fa66370e3c73dcba8b11140518f640e02123b