상세 컨텐츠

본문 제목

keycloak

카테고리 없음

by moneygom 2018. 8. 24. 01:19

본문

반응형

소개

"Open Source Identity and Access Management" for Modern Application and Services

홈페이지

https://www.keycloak.org/

문서

https://www.keycloak.org/documentation.html

Guides

Release Notes
Getting StartedHow to get started with Keycloak
Server Installation and ConfigurationInstallation and offline configuration of the Keycloak server
Securing Applications and ServicesHow to secure applications and services with Keycloak
Server AdministrationManagement and runtime configuration of the Keycloak server
Server DeveloperCreating themes and providers to customize the Keycloak server
Authorization ServicesCentrally manage fine-grained permissions for applications and services
UpgradingUpgrading Keycloak server and adapters

API Documentation

JavaDocDocumentation for Java API
Administration REST APIDocumentation for the Adminstration RESTful API


소스코드

https://github.com/keycloak/keycloak

기술지원

https://www.keycloak.org/support.html

커뮤니티 오픈소스 버젼에 대한 지원은 불가하며 'RH-SSO(Red Hat Single Sign On)' 에 대한 구매로 Commercial Support가 가능하다.

JBoss EAP 관련 구매한 경우에는 'RH-SSO'가 포함된 관계로 별도 구매 없이 지원이 가능하며 별도 RH-SSO만 구매는 안된다.

현재 Commercial Support 지원 버젼은 아래와 같다. (커뮤니티 버젼은 4.3.0)

RH-SSO 7.2.0.GADerived from Keycloak 3.4.3.Final
RH-SSO 7.1.0.GADerived from Keycloak 2.5.5.Final
RH-SSO 7.0.0.GADerived from Keycloak 1.9.8.Final

커뮤니티

https://www.keycloak.org/community.html

User Mailing List : https://lists.jboss.org/mailman/listinfo/keycloak-user
JIRA : https://issues.jboss.org/browse/KEYCLOAK
Search documentation and forums : https://www.keycloak.org/search.html


Architecture

Policy Administration Point(PAP)

Provides a set of UIs based on the Keycloak Administration Console to manage resource servers, resources, scopes, permissions, and policies. Part of this is also accomplished remotely through the use of the Protection API.

Policy Decision Point(PDP)

Provides a distributable policy decision point to where authorization requests are sent and policies are evaluated accordingly with the permissions being requested. Part of this is also accomplished remotely through the use of the Authorization and Entitlement APIs.

Policy Enforcement Point(PEP)

Provides implementations for different environments to actually enforce authorization decisions at the resource server side. Keycloak provides some built-in Policy Enforcers.

Policy Information Point(PIP)

Being based on Keycloak Authentication Server, you can obtain attributes from identities and runtime environment during the evaluation of authorization policies.

AuthZ Process



Maven Building

$ mvn clean install -DskipTests=true


Starting Keycloak

To start Keycloak during development first build as specified above, then run:

mvn -f testsuite/utils/pom.xml exec:java -Pkeycloak-server 

To start Keycloak from the server distribution first build the distribution it as specified above, then run:

tar xfz distribution/server-dist/target/keycloak-<VERSION>.tar.gz
cd keycloak-<VERSION>
bin/standalone.sh

위의 내용과 같이 testsuite으로 기동하여 Keycloak을 살펴볼 수 있으며, Build된 버젼으로도 구동이 가능하다.

또한, 최신 빌드 버젼을 다운로드 받아 구동이 가능하다.

Download : https://www.keycloak.org/downloads.html


Client Adapters

Keycloak client adapters = librares & provide a tight intergration to the underlying platform and framework.

Supported Platform

Choosing between OpenID Connect and SAML is not just a matter of using a newer protocol (OIDC) instead of the older more mature protocol (SAML).

TYPE

NAME 

VERSION 

OpenID Connect(OIDC)

WildFly 

9, 10, 11, 8(deprecated) 

 

JBoss EAP 

6, 7

 

JBoss AS 

7.1(deprecated)

 

JBoss Fuse 

6.2, 6.3 

 

JavaScript 

 

 

Jetty 

9.2, 9.3, 9.4, 8.1(deprecated), 9.1(deprecated)

 

Tomcat 

7, 8, 6(deprecated) 

 SAML 2.0

WildFly

9, 10, 11

 

JBoss EAP

6, 7 
 JBoss AS 

7.1(deprecated)

 

Jetty 

9.2, 9.3, 9.4, 8.1(deprecated)

 Tomcat 

7, 8, 6(deprecated) 

Downloads : https://www.keycloak.org/downloads.html


Administrator Console

초기 계정 생성

Keycloak은 관리자 콘솔화면을 제공한다. 예제로 로컬환경에서 구동하면 최초 접속시에 초기 관리자를 생성해야 한다.

관리자 접속

최초 접속 후에 다시 'Administration Console' 로 접속하면 다음과 같이 Login 페이지로 이동한다. 

초기 생성한 관리자 계정으로 Log in 정보를 등록하여 관리자 콘솔에 접속한다.

 

Configure

"Realm Settings, Clients, Client Scopes, Roles, Identity Providers, User Federation, Authentication" 의 메뉴로 분류된 기능을 제공한다.

Manage

"Groups, Users, Sessions, Events, Import, Export"의 메뉴로 분류된 기능을 제공한다.

Identity Providers

Keycloak using external Identity Providers or Social Networks. 라고 명시한 내용 처럼 OpenID Connect & SAML 2.0 기반으로 User-defined 또는 Social(GitHub, Facebook 등) 을 이용한 인증이 가능하다.

Add identity provider 

GitHub의 사용자 계정을 이용하여 OAuth2 인증을 통한 등록이 가능하다. GitHub에서 OAuth Client ID, Client Secret 정보를 등록하여 사이트 유효성을 등록할 수 있다.
GitHub의 경우에는 Settgins / Developer settings 을 통하여 'OAuth Apps'에 등록한다.



Add Iendity provider에 GitHub의 OAuth Client ID/Secret 정보를 등록 후 저장한다.

저장 후에 Log out 이후에 다시 로그인 페이지로 접속하면 아래와 같이 Log in 페이지가 분리되며 오른쪽에 추가한 Provider 정보가 제공된다.


User Federation

Keycloak can federate external user databases. Out of the box we have support for LDAP and Active Directory.

References


Relational Database Setup

Keycloak 은 기본적으로 embedded Java-based relational database called H2를 제공하여 기동된다. 기능 테스트 단계에서는 H2를 기반으로 사용해도 되겠지만, 운영환경 등을 고려하면 Database 분리가 필요하다.

RDBMS Setup Checklist

RDBMS를 선택한 후 Keycloak에 구성하기 위해서는 아래 단계로 진행을 해야 한다.

  1. Locate and download a JDBC driver for your database

  2. Package the driver JAR into a module and install this module into the server

  3. Declare the JDBC driver in the configuration profile of the server

  4. Modify the datasource configuration to use your database’s JDBC driver

  5. Modify the datasource configuration to define the connection parameters to your database

PostgreSQL Setting

PostgreSQL의 버젼과 JDBC버젼은9.4 버젼 이후로 별개의 버젼으로 진행한다고 보면 된다.
PostgreSQL 9.6 버젼으로 RDBMS를 구성한다고 하더라도 최신 버젼인 JDBC 42.X 버젼으로 사용하면 된다.
Java 버젼에 따라 JDBC 4.0(Java 6), 4.1(Java 7), 4.2(Java 8) 로 나눠진다.



Module XML

PostgreSQL JDBC 4.2 Driver, 42.2.5 버젼으로 Module XML 설정하는 경우 예제
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
    <resources>
        <resource-root path="postgresql-42.2.5.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>


Declare and Load JDBC Driver

운영모드 에 따라 JBoss(Wildfly)의 아래 경로의 설정 파일을 수정해야 한다.

- Standalone mode : /standalone/configuration/standalone.xml

- Custer mode : /standalone/configuration/standalone-ha.xml

- Doamin mode : /domain/configuration/domain.xml


Internationalization

한글팩이 없어 Pull Request 준비해야겠다.


kubernetes dashboard with openid connect



반응형