docs: B-2 — sharing the stores fixes one problem and exposes three more
Moving the authorized client to JdbcOAuth2AuthorizedClientService makes tokens work across replicas, so the session-in-Redis plus tokens-in-PostgreSQL split holds. The table then shows what sharing cannot fix: the primary key is (client_registration_id, principal_name) with no session in it, so a second login for the same user updates the same row rather than adding one. The refresh token sits in bytea as the raw JWT, readable with convert_from, and logout clears only the Redis session while the plaintext token row and the Keycloak SSO session both survive. The schema itself failed silently first because the default DDL uses blob, which PostgreSQL does not have, and continue-on-error swallowed it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f2595f748f
commit
711878379c
@@ -10,6 +10,23 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: keycloak-bff
|
||||
datasource:
|
||||
# B-2: authorized client 전용. Keycloak 과 같은 PostgreSQL 인스턴스지만
|
||||
# 테이블이 다르다(oauth2_authorized_client). 운영이라면 분리를 검토한다.
|
||||
url: ${BFF_DB_URL:jdbc:postgresql://localhost:5432/keycloak}
|
||||
username: ${BFF_DB_USER:keycloak}
|
||||
password: ${BFF_DB_PASSWORD:keycloak}
|
||||
sql:
|
||||
init:
|
||||
# Spring Security 가 제공하는 DDL 을 그대로 쓴다.
|
||||
# always 로 두면 매 기동마다 실행되므로 CREATE TABLE IF NOT EXISTS 가 아닌
|
||||
# 스크립트에서는 실패한다 → continue-on-error 로 넘긴다.
|
||||
mode: ${SPRING_SQL_INIT_MODE:always}
|
||||
# ★ PostgreSQL 은 -postgres 판본을 써야 한다. 기본 판본은 `blob` 타입을
|
||||
# 쓰는데 PostgreSQL 에는 그 타입이 없다(`bytea` 다). continue-on-error 가
|
||||
# 그 실패를 삼켜서 "테이블이 조용히 안 생기는" 상태가 됐었다.
|
||||
schema-locations: classpath:org/springframework/security/oauth2/client/oauth2-client-schema-postgres.sql
|
||||
continue-on-error: true
|
||||
data:
|
||||
redis:
|
||||
host: ${REDIS_HOST:localhost}
|
||||
|
||||
Reference in New Issue
Block a user