18.12. ストレージプロバイダー操作
Kerberos ストレージプロバイダーの設定
-
components
エンドポイントに対してcreate
コマンドを使用します。 -
レルム ID を
parentId
属性の値として指定します。 -
kerberos
をproviderId
属性値として指定し、org.keycloak.storage.UserStorageProvider
をproviderType
属性値として指定します。 以下に例を示します。
$ kcadm.sh create components -r demorealm -s parentId=demorealmId -s id=demokerberos -s name=demokerberos -s providerId=kerberos -s providerType=org.keycloak.storage.UserStorageProvider -s 'config.priority=["0"]' -s 'config.debug=["false"]' -s 'config.allowPasswordAuthentication=["true"]' -s 'config.editMode=["UNSYNCED"]' -s 'config.updateProfileFirstLogin=["true"]' -s 'config.allowKerberosAuthentication=["true"]' -s 'config.kerberosRealm=["KEYCLOAK.ORG"]' -s 'config.keyTab=["http.keytab"]' -s 'config.serverPrincipal=["HTTP/localhost@KEYCLOAK.ORG"]' -s 'config.cachePolicy=["DEFAULT"]'
LDAP ユーザーストレージプロバイダーの設定
-
components
エンドポイントに対してcreate
コマンドを使用します。 -
ldap
をproviderId
属性の値に、org.keycloak.storage.UserStorageProvider
をproviderType
属性値として指定します。 -
レルム ID を
parentId
属性の値として指定します。 以下の例を使用して、Kerberos が統合する LDAP プロバイダーを作成します。
$ kcadm.sh create components -r demorealm -s name=kerberos-ldap-provider -s providerId=ldap -s providerType=org.keycloak.storage.UserStorageProvider -s parentId=3d9c572b-8f33-483f-98a6-8bb421667867 -s 'config.priority=["1"]' -s 'config.fullSyncPeriod=["-1"]' -s 'config.changedSyncPeriod=["-1"]' -s 'config.cachePolicy=["DEFAULT"]' -s config.evictionDay=[] -s config.evictionHour=[] -s config.evictionMinute=[] -s config.maxLifespan=[] -s 'config.batchSizeForSync=["1000"]' -s 'config.editMode=["WRITABLE"]' -s 'config.syncRegistrations=["false"]' -s 'config.vendor=["other"]' -s 'config.usernameLDAPAttribute=["uid"]' -s 'config.rdnLDAPAttribute=["uid"]' -s 'config.uuidLDAPAttribute=["entryUUID"]' -s 'config.userObjectClasses=["inetOrgPerson, organizationalPerson"]' -s 'config.connectionUrl=["ldap://localhost:10389"]' -s 'config.usersDn=["ou=People,dc=keycloak,dc=org"]' -s 'config.authType=["simple"]' -s 'config.bindDn=["uid=admin,ou=system"]' -s 'config.bindCredential=["secret"]' -s 'config.searchScope=["1"]' -s 'config.useTruststoreSpi=["ldapsOnly"]' -s 'config.connectionPooling=["true"]' -s 'config.pagination=["true"]' -s 'config.allowKerberosAuthentication=["true"]' -s 'config.serverPrincipal=["HTTP/localhost@KEYCLOAK.ORG"]' -s 'config.keyTab=["http.keytab"]' -s 'config.kerberosRealm=["KEYCLOAK.ORG"]' -s 'config.debug=["true"]' -s 'config.useKerberosForPasswordAuthentication=["true"]'
ユーザーストレージプロバイダーインスタンスの削除
-
ストレージプロバイダーインスタンスの
id
属性を使用して、components/ID
などのエンドポイント URI を作成します。 このエンドポイントに対して
delete
コマンドを実行します。以下に例を示します。
$ kcadm.sh delete components/3d9c572b-8f33-483f-98a6-8bb421667867 -r demorealm
特定のユーザーストレージプロバイダーに対するすべてのユーザーの同期のトリガー
-
ストレージプロバイダーの
id
属性を使用して、user-storage/ID_OF_USER_STORAGE_INSTANCE/sync
などのエンドポイント URI を作成します。 -
action=triggerFullSync
クエリーパラメーターを追加します。 create
コマンドを実行します。以下に例を示します。
$ kcadm.sh create user-storage/b7c63d02-b62a-4fc1-977c-947d6a09e1ea/sync?action=triggerFullSync
特定のユーザーストレージプロバイダーに対する変更済みのユーザーの同期のトリガー
-
ストレージプロバイダーの
id
属性を使用して、user-storage/ID_OF_USER_STORAGE_INSTANCE/sync
などのエンドポイント URI を作成します。 -
action=triggerChangedUsersSync
クエリーパラメーターを追加します。 create
コマンドを実行します。以下に例を示します。
$ kcadm.sh create user-storage/b7c63d02-b62a-4fc1-977c-947d6a09e1ea/sync?action=triggerChangedUsersSync
LDAP ユーザーのストレージ接続性のテスト
-
testLDAPConnection
エンドポイントでget
コマンドを実行します。 -
クエリーパラメーター
bindCredential
、bindDn
、connectionUrl
、およびuseTruststoreSpi
を提供します。 action
クエリーパラメーターをtestConnection
に設定します。以下に例を示します。
$ kcadm.sh create testLDAPConnection -s action=testConnection -s bindCredential=secret -s bindDn=uid=admin,ou=system -s connectionUrl=ldap://localhost:10389 -s useTruststoreSpi=ldapsOnly
LDAP ユーザーのストレージ認証のテスト
-
testLDAPConnection
エンドポイントでget
コマンドを実行します。 -
クエリーパラメーター
bindCredential
、bindDn
、connectionUrl
、およびuseTruststoreSpi
を指定します。 action
クエリーパラメーターをtestAuthentication
に設定します。以下に例を示します。
$ kcadm.sh create testLDAPConnection -s action=testAuthentication -s bindCredential=secret -s bindDn=uid=admin,ou=system -s connectionUrl=ldap://localhost:10389 -s useTruststoreSpi=ldapsOnly