--- title: Keycloak — Securing Apps Overview source_type: official-doc url: https://www.keycloak.org/securing-apps/overview archive_url: status: raw confidence: medium tags: [keycloak-patterns, p2a-spa-resource-server, keycloak, oidc, oauth2, adapter] related_projects: [keycloak-patterns] related_branches: [feature-keycloak-patterns, feature-keycloak-internal-spa-direct-no-google, feature-keycloak-bff-vs-spa-direct, feature-keycloak-spring-rs-audience-validator] created: 2026-05-25 last_reviewed: 2026-05-27 --- # Keycloak — Securing Apps Overview > Layer: `raw/official-docs/` — Keycloak 공식 Securing Applications and Services 의 overview 페이지 발췌. P2A 의 표준 OIDC library 우선 / adapter 회피 결정의 근거. ## Parent / 활용 branch (필수) | Branch | 이 자료가 정당화하는 결정 | |---|---| | [[raw/branch-notes/feature-keycloak-patterns]] | Keycloak 통합 시 protocol (OIDC/OAuth2/SAML) 우선, adapter 는 최후 수단이라는 공식 권고 — P-pattern 전반 통합 방식 분류 근거 | | [[raw/branch-notes/feature-keycloak-internal-spa-direct-no-google]] | P2A SPA Direct 에서 `keycloak-js` 대신 표준 OIDC library 채택 가능성 근거 | | [[raw/branch-notes/feature-keycloak-bff-vs-spa-direct]] | "Keycloak 이 어떤 stack 에든 protocol 만 있으면 통합 가능" 이라는 공식 진술의 출처 | | [[raw/branch-notes/feature-keycloak-spring-rs-audience-validator]] | backend = Resource Server 가 표준 OAuth2 / OIDC library (Spring Security oauth2-resource-server) 로 충분하다는 결정의 출처 | ## 컨텍스트 P2A 패턴에서 Keycloak이 SPA 와 backend 를 각각 어떻게 다루는지 (protocol 우선 / adapter 는 최후 수단), 그리고 client 등록과 protocol 활성화의 두 단계를 명확히 인용으로 보존. "Keycloak 공식이 권하는 통합 방식" 근거. ## 출처 / Source - 원본 URL: https://www.keycloak.org/securing-apps/overview - 아카이브 URL: (미수집) - 저자 / 조직: Keycloak (Red Hat) — Securing Applications and Services - 발행일: rolling docs - 마지막 확인일: 2026-05-27 - **주의**: 메인 latest URL (`/docs/latest/securing_apps/`) 이 404 응답. 위 overview 경로로 fallback. 향후 정확한 latest URL 은 Keycloak release notes 에서 재확인 필요. ## 핵심 인용 / Key quotes (verbatim) > [§Overview — supported protocols] "Keycloak can secure any application and service as long as the technology stack they are using supports any of these protocols" > [§Overview — Keycloak Client Adapters] "Keycloak Client Adapters ... should be used as a last resort if you cannot rely on what is available from the application ecosystem." > [§Overview — two basic steps, **needs-confirmation**] "두 가지 기본 단계: (1) realm 에 client 등록, (2) 애플리케이션에서 지원되는 protocol 활성화" 는 원본 한국어 paraphrase 로 보존되어 있어 verbatim 영어 원문이 본 raw 의 발췌 범위에 없음. wiki 추출 시 영어 원문 재확보 필요. ## Claims Extracted / 추출된 주장 | Claim ID | Claim (이 자료가 직접 말하는 것) | Evidence quote | Strength | Applies to | Does not prove | |---|---|---|---|---|---| | KC-SECAPP-C1 | Keycloak 은 사용 중인 technology stack 이 (Keycloak 이 지원하는) protocol 중 하나만 지원하면 어떤 application/service 도 secure 할 수 있다 | [§Overview — supported protocols] "Keycloak can secure any application and service as long as the technology stack they are using supports any of these protocols" | `official-vendor-doc` | OIDC / OAuth 2.0 / SAML 2.0 중 하나를 지원하는 모든 stack | 본 인용 자체에는 "OIDC, OAuth 2.0, SAML 2.0" 의 정확한 enumeration 이 포함되지 않음 (overview 페이지 다른 곳에 위치 추정) — protocol 목록은 별도 확인 | | KC-SECAPP-C2 | Keycloak Client Adapter 는 application ecosystem 에서 표준 library 를 활용할 수 없는 경우의 **최후 수단** (last resort) 으로 사용해야 함 | [§Overview — Keycloak Client Adapters] "Keycloak Client Adapters ... should be used as a last resort if you cannot rely on what is available from the application ecosystem." | `official-vendor-doc` | Keycloak adapter 도입 결정 (Java / Spring / Node 등) | 어떤 stack 이 "ecosystem 에 의존 가능" 한지의 명시적 기준은 본 인용에 없음 — 판단은 개발자 책임 | | KC-SECAPP-C3 | "두 가지 기본 단계: realm 에 client 등록 + application 에서 protocol 활성화" 는 본 raw 에 한국어 paraphrase 만 존재 — 영어 원문 verbatim 부재 | (verbatim 부재 — 부재 자체가 claim) | `needs-confirmation` | Keycloak 통합 작업 순서 | 해당 단계 구분이 틀렸다는 뜻은 아님. 영어 원문 재확보 후 승격 가능 | ## Usage Boundaries / 적용 경계 - **이 자료가 직접 증명하는 것**: - `KC-SECAPP-C1`: protocol 만 있으면 통합 가능하다는 일반 원칙 - `KC-SECAPP-C2`: Adapter 는 last resort 라는 공식 권고 - **이 자료가 증명하지 않는 것**: - `KC-SECAPP-C3`: 통합의 정확한 단계 (영어 원문 부재) - 정확한 protocol 목록 (OIDC / OAuth2 / SAML) 의 verbatim enumeration - PKCE / Direct Access Grants / Standard Flow 등 세부 OIDC 설정 정책 (overview 범위 밖) - adapter 가 deprecated 인지 / 어떤 버전에서 제거되는지의 정확한 timeline - **내 프로젝트에 적용하려면 추가 확인이 필요한 것**: - P2A SPA 에 대해 `keycloak-js` vs 표준 OIDC library (`oidc-client-ts` 등) 의 실제 trade-off (token 갱신 / silent SSO / logout 동작 차이) - Spring Security oauth2-resource-server 가 Keycloak 의 audience / role claim 을 무리 없이 받는지의 실제 검증 ## 메모 / Notes > 검증되지 않은 내 해석은 여기에 두지 말 것 — wiki source-summary 단계에서. - P2A 에 적용: - SPA = public client. Standard Flow Enabled (Authorization Code), Direct Access Grants OFF, PKCE S256 enforced. - Backend = bearer-only (Keycloak 4.x 이전 명칭) / Service Accounts 미사용. 단순 Resource Server. - SPA 측 library: `keycloak-js` adapter 또는 표준 OIDC client library (`oidc-client-ts`). 공식 가이드는 표준 library 우선. - Adapter 비권장 이유 (해석): Keycloak adapter 는 Keycloak 에 lock-in 되고, 표준 OIDC 가 더 portable. P2A 는 표준 흐름만 사용하므로 adapter 없이 구현 가능. - 본 URL 은 overview 수준 — 구체적인 PKCE 설정, redirect URI exact match 정책 등은 Server Administration Guide / 별도 챕터에서 확인. - 2026-05-27 재migration: WebFetch 권한 부재로 라이브 재검증 불가. C1/C2 는 기존 발췌 보존, C3 는 `needs-confirmation` 분리. ## Related / 관련 - 같은 주제 다른 official-doc: - [[raw/official-docs/keycloak-reverseproxy-official]] — proxy 환경에서의 hostname / proxy header - [[raw/official-docs/keycloak-hostname-configuration]] — issuer URL 결정 - [[raw/official-docs/keycloak-server-containers-docker]] — 운영 모드 / KC_* 환경변수 - 인용하는 branch: - [[raw/branch-notes/feature-keycloak-patterns]] - [[raw/branch-notes/feature-keycloak-internal-spa-direct-no-google]] - [[raw/branch-notes/feature-keycloak-bff-vs-spa-direct]] - [[raw/branch-notes/feature-keycloak-spring-rs-audience-validator]] - 인용한 wiki: (미작성)