使用Postman在KeyClove中创建新用户

使用Postman在KeyClove中创建新用户,postman,keycloak,Postman,Keycloak,我想使用postman在KeyClope中创建一个新用户 我得到一个代币 https://xxxxxx/auth/realms/MyRealm/protocol/openid-connect/token header: Content-Type:application/x-www-form-urlencoded body: grant_type:password client_id:admin-cli client_secret:asdf-asdf-asdf-as

我想使用postman在KeyClope中创建一个新用户

我得到一个代币

https://xxxxxx/auth/realms/MyRealm/protocol/openid-connect/token
header:
    Content-Type:application/x-www-form-urlencoded
body:
    grant_type:password
    client_id:admin-cli
    client_secret:asdf-asdf-asdf-asdf-asdf
    username:testuser1
    password:1234
如果我尝试创建一个新用户,我会根据地址得到404或401

404: https://xxxxxx/auth/realms/MyRealm/users
401: https://xxxxxx/auth/admin/realms/MyRealm/users

header:
    Authorization Bearer asdfasdfasdfasdfasdfasdf
    Content-Type application/json
no body: // The error is the same even with body
我想当使用auth/admin时,我还需要一个auth/admin令牌,但我不知道如何做

如果我尝试在auth/admin下为同一个或admin用户获取令牌,在这两种情况下,我都会得到401

使用管理员用户凭据获取/auth/realms下的令牌会导致401无效用户凭据


有什么想法吗?

是testuser1领域管理员吗?您需要管理员来调用keydepeapi。可能您输入了错误的管理员用户名和密码,因为如果您使用与管理员凭据相同的调用,它必须工作。testuser1是域管理员吗?您需要管理员来调用keydepeapi。可能您输入了错误的管理员用户名和密码,因为如果您使用相同的管理员凭据呼叫,它必须工作。