v-ladynev / keycloak-nodejs-example

A simply step by step Keycloak, MySQL and Node.js integration tutorial. There are some docker examples as well.
292 stars 101 forks source link

Issue when try add new user #4

Closed NomiasSR closed 3 years ago

NomiasSR commented 6 years ago

Hello for all,

After doing all configurations my example is working fine, but when I try add a new user the system shown this message on the bottom of the screen: <!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n404 Not Found\n\n

Not Found

\n

The requested URL /auth/realms/master/protocol/openid-connect/token was not found on this server.

\n
\n
Apache/2.4.33 (Win64) PHP/7.2.4 Server at localhost Port 8080
\n\n

I would like to know how can I do to fix this issue or if keycloak has some external API when I could create new users.

Regards

Paulo

v-ladynev commented 6 years ago

@NomiasSR Hello. Yes Keycloak has REST API to create new users. You can find an example here https://github.com/v-ladynev/keycloak-nodejs-example/blob/master/lib/adminClient.js#L35

Your error means that you specified an incorrect URL. The URL for this example here https://github.com/v-ladynev/keycloak-nodejs-example/blob/master/keycloak.json#L3

Also, It will be better if you try to create a new user using REST API Client like Postman and after that will continue to work with the code.