Couldn't complete authentication for new access token after changing localhost to keycloak in access token url
GeorgeTan615 opened this issue · 5 comments
First of all, thanks for the great content! However as I was following through part 9 of dockerizing the application, I was not able to get a new access token even after changing localhost to keycloak in the access token url. I also made changes to my hosts file to point the keycloak hostname to the localhost IP address of 127.0.0.1. I also made sure to regenerate a new client secret.
I've also tried running the docker-compose.yml file in this GitHub repository just in case my own docker-compose file had issues, but the problem still persisted even after running Sai's docker-compose.yml file.
Do note that everything is fine when the applications were ran locally and not in the docker containers.
@GeorgeTan615 In Postman, you will see console at the bottom, check what is the error you are receiving while requesting the token
@SaiUpadhyayula Here is the error that I've gotten. Thanks!
@GeorgeTan615 Which keycloak version are you using ? If you are using 19+, then remove the /realm from the url, it's no longer needed.
@SaiUpadhyayula Judging from the docker-compose.yml
file, I believe its version 18.
@SaiUpadhyayula A little update on my situation. I'm able to get the access token now, turns out for some reason, my dockerized api gateway does not start on the port that I've specified and it always runs on port 8080, so after changing the issuer uri and token url to 8080, I'm able to get the access token. However upon sending the request in Postman, I would get iss claim not valid, but I did change localhost to keycloak and modified my hosts file.