Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

setting Keycloak url in spring boot in a dockerized environment

I'm trying to connect my spring boot project to a Keycloak authorization server and this is my application.yml config

spring:
  security:
    oauth2:
      client:
        registration:
          keycloak:
            client-id: my_client
            client-secret: my_client_secret
        provider:
          keycloak:
            issuer-uri: http://keycloak:8080/auth/realms/my_realm
            token-uri: ${spring.security.oauth2.client.provider.keycloak.issuer-uri}/protocol/openid-connect/token

when I try to reach to my project and login through Keycloak, I will end up in this page

http://keycloak:8080/auth/realms/my_realm/protocol/openid-connect/....

instead of this

http://localhost:8080/auth/realms/my_realm/protocol/openid-connect/....

and I don't want to use my exposed url in my code.

question from:https://stackoverflow.com/questions/65870019/setting-keycloak-url-in-spring-boot-in-a-dockerized-environment

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...