我正在嘗試將在本地 Kubernetes 集群上運行的 Keycloak 與 Spring Security OAuth 應用程式連接起來。當我使用 k8s 從 k8s 移植 Keycloak 時,kubectl port-forward svc/keycloak 8080:8080我可以毫無問題地訪問 Web GUI,但是在使用 Spring Security 進行授權時,它總是會拋出錯誤
Invalid token issuer. Expected 'http://localhost:8080/auth/realms/master', but was 'http://10.104.81.255:8080/auth/realms/master'
這是我在 Spring 中的 Keycloak 配置
keycloak:
realm: master
auth-server-url: http://localhost:8080/auth
ssl-required: external
resource: my-resource
use-resource-role-mappings: true
public-client: true
請讓我知道如何設定它,以便我可以繼續在本地開發。
注意:當 Spring 應用程式在集群中運行并且我轉而轉發該應用程式時,它顯然可以完美運行。
uj5u.com熱心網友回復:
看起來您還沒有frontendUrl為Hostname provider配置。設定為http://localhost:8080/auth,你應該沒問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/342758.html
上一篇:從ENUM回傳值
下一篇:聲納錯誤:使用try-with-resources或在“finally”子句中關閉此“ZipOutputStream”
