정구리의 우주정복
[Keycloak] Resource, Representation 차이 본문
반응형
Resource 는 데이터 또는 엔티티를 가리킴.
사용자, 클라이언트, 그룹등의 엔티티가 Resource 에 해당됨
Representation 는 '특정' 리소스의 데이터 표현
리소스에 대한 상세한 정보나 설정, 속성등이 Representation 으로 표현됨. 리소스의 상태를 조작할 수 있음.
User 라는 큰 개념이 Resource 이고
User 안의 jungry 라는 사람이 Representation 이 되는거
// Group 정보 가져오기
GroupResource groupResource = realmResource.groups().group(body.getUuid());
GroupRepresentation groupRepresentation = groupResource.toRepresentation();
groupRepresentation.setName(body.getName());
groupResource.update(groupRepresentation);
GroupResource 사용해서 group 에 대해서 가져오고 그걸 Representation 으로 바꿈
그럼 Representation 에는 특정 group 에 대한 정보가 들어있을거임
그 특정 group 의 이름을 바꿔주고
GroupResource 를 update 해서 적용을 해주는 방식으로 사용하면 아주 굿이에영
반응형
Comments