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"]'
$ 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"]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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"]'
$ 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"]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
ユーザーストレージプロバイダーインスタンスの削除
-
ストレージプロバイダーインスタンスの
id属性を使用して、components/IDなどのエンドポイント URI を作成します。 このエンドポイントに対して
deleteコマンドを実行します。以下に例を示します。
kcadm.sh delete components/3d9c572b-8f33-483f-98a6-8bb421667867 -r demorealm
$ kcadm.sh delete components/3d9c572b-8f33-483f-98a6-8bb421667867 -r demorealmCopy to Clipboard Copied! Toggle word wrap Toggle overflow
特定のユーザーストレージプロバイダーに対するすべてのユーザーの同期のトリガー
-
ストレージプロバイダーの
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
$ kcadm.sh create user-storage/b7c63d02-b62a-4fc1-977c-947d6a09e1ea/sync?action=triggerFullSyncCopy to Clipboard Copied! Toggle word wrap Toggle overflow
特定のユーザーストレージプロバイダーに対する変更済みのユーザーの同期のトリガー
-
ストレージプロバイダーの
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
$ kcadm.sh create user-storage/b7c63d02-b62a-4fc1-977c-947d6a09e1ea/sync?action=triggerChangedUsersSyncCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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
$ kcadm.sh create testLDAPConnection -s action=testConnection -s bindCredential=secret -s bindDn=uid=admin,ou=system -s connectionUrl=ldap://localhost:10389 -s useTruststoreSpi=ldapsOnlyCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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
$ kcadm.sh create testLDAPConnection -s action=testAuthentication -s bindCredential=secret -s bindDn=uid=admin,ou=system -s connectionUrl=ldap://localhost:10389 -s useTruststoreSpi=ldapsOnlyCopy to Clipboard Copied! Toggle word wrap Toggle overflow