약간의 노력 끝에 나는 여전히 OIDC로 직접 적나라한 가장의 기능을 재현 할 수 없습니다.
심판 : https://www.keycloak.org/docs/latest/securing_apps/#direct-naked-impersonation
같은 오류가 발생했습니다.
curl -X POST http://localhost:8080/auth/realms/iot/protocol/openid-connect/token \
-d "client_id=backend-service" \
-d "client_secret=f0ead74d-c3eb-47c5-82fd-d8fccc5e5096" \
--data-urlencode "grant_type=urn:ietf:params:oauth:grant-type:token-exchange" \
-d "requested_subject=1c04c634-a64a-4905-b87f-e654ca01b889"
{"error":"access_denied","error_description":"Client not allowed to exchange"}
아래는 내 개발 구성입니다.
$ cat docker-compose.yaml
version: '2.4'
volumes:
postgres_data:
driver: local
services:
postgres:
image: postgres:12-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
keycloak:
image: jboss/keycloak:10.0.1
environment:
DB_VENDOR: POSTGRES
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_USER: postgres
DB_SCHEMA: public
DB_PASSWORD: postgres
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
#JDBC_PARAMS: "ssl=true"
ports:
- 8080:8080
volumes:
- /etc/localtime:/etc/localtime:ro
command: -Dkeycloak.profile=preview
depends_on:
- postgres
realm-export.json https://gist.github.com/whisper-bye/20c86de26459efe641008ba5f448f3f1
전문가에게는 특정 클라이언트가 가장 기능을 사용하도록 허용하는 정책이 없습니다.
내 Realm의 예 :
{
"id": "7588d6d2-82b6-42ef-9bd0-e9c01a2dc92b",
"name": "admin-impersonating.permission.users",
"description": "Client foo may impersonate any user",
"type": "scope",
"logic": "POSITIVE",
"decisionStrategy": "UNANIMOUS",
"config": {
"resources": "[\"Users\"]",
"scopes": "[\"impersonate\"]",
"applyPolicies": "[\"foo client-policy\"]"
}
}
이 햇 관리 / 사용자를 왼쪽에서 구성한 다음 오른쪽에서 "권한"을 구성 할 수 있습니다. 이 메뉴 항목은 -Dkeycloak.profile.feature.admin_fine_grained_authz=enabled -Dkeycloak.profile.feature.token_exchange=enabled
!로 Keycloak을 시작할 때만 나타납니다 .
그런 다음 "가장"을 클릭하고 "정책 적용"에 설정이 있는지 확인하십시오.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다