# Keycloak and spring app running on different docker containers

**URL:** <https://forum.keycloak.org/t/keycloak-and-spring-app-running-on-different-docker-containers/27692>\
**Category:** Getting advice\
**Created:** [September 1, 2024, 9:28pm UTC](https://forum.keycloak.org/t/keycloak-and-spring-app-running-on-different-docker-containers/27692 "2024-09-01T21:28:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![clau100](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/clau100/32/11177_2.png) [@clau100](https://forum.keycloak.org/u/clau100)\
**Post date:** [September 1, 2024, 9:28pm UTC](https://forum.keycloak.org/t/keycloak-and-spring-app-running-on-different-docker-containers/27692/1 "2024-09-01T21:28:19Z")

</div>

Hello!  
I am trying to use keycloak with my spring application.  
They work in docker containers, on the same network.  
When I run my application in a docker container (and give all it’s urls to keycloak like: keycloak:8080 ) it either doesn’t work because the login url I get back is keycloak:8080/realms/my-realm/protocol/openid-connect/auth…

or if I change the authorization-uri in my application.yaml, I get to the login page, but after logging in with a user I get:

## Login with OAuth 2.0

invalid\_id\_token An error occurred while attempting to decode the Jwt: The ID Token contains invalid claims: iss=localhost:8080/realms/my-realm

keycloak:8080/realms/my-realm localhost:1234/oauth2/authorization/keycloak

What config/ yaml property should I change, or how can I change my security config so that it works?
