Warm tip: This article is reproduced from serverfault.com, please click

java-使用管理控制台API导出密钥斗篷中具有凭据的用户

(java - Export users with credential in keycloak with Admin Console API)

发布于 2020-12-10 09:42:13

如何使用管理控制台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
    }
},

如何恢复具有凭证的用户?

Questioner
c'est moi
Viewed
11
dreamcrash 2020-12-10 22:24:54

不,使用该端点将不会返回你的用户凭据。但是,你可以使用端点使用凭据导入用户:

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

你可以在Red Hat文档和/或此博客中阅读有关此选项的更多详细信息。