如何使用管理控制台API在keycloak中导出具有凭据的用户
我使用了此终结点,但其中不包含用户的凭据
curl -X GET https://$KEYCLOAK_IP/auth/admin/realms/$REALM_NAME/users
{
"id": "dbede89b-dbf8-4b4b-84a6-da7b6c1877e3",
"createdTimestamp": 1607591201217,
"username": "admin",
"enabled": true,
"totp": false,
"emailVerified": false,
"disableableCredentialTypes": [],
"requiredActions": [],
"notBefore": 0,
"access": {
"manageGroupMembership": true,
"view": true,
"mapRoles": true,
"impersonate": true,
"manage": true
}
},
如何恢复具有凭证的用户?
不,仅使用该端点将不会返回你的用户凭据。但是,你可以使用端点使用凭据导入用户:
PUT https://$KEYCLOAK_IP/auth/admin/realms/$REALM_NAME/users
要使用用户的密码导出用户,你可以-Dkeycloak.migration.action=export
在启动密钥斗篷时通过该选项:
bin/standalone.sh -Dkeycloak.migration.action=export
和类似的进口只是使用-Dkeycloak.migration.action=import
。