通过curl在wso2中进行用户身份验证

时间:2019-09-23 20:59:16

标签: authentication curl wso2

我需要通过curl命令对管理员用户进行身份验证,以便可以在wso2中实用地添加,删除,修改用户

我可以调用api端点来为用户添加/修改/删除没有问题。但是,如果无法先对wso2进行身份验证,那将是徒劳的。当我发送curl命令时,没有任何响应,日志中也没有任何显示。

这是我的基本curl命令,直接在书中: curl -X POST“ https://xxxxxxx.com:9443/login/portal” -H“内容类型:application / x-form-urlencoded” -d“ username = uid&password = foo&grantType = password”

1 个答案:

答案 0 :(得分:0)

您可以将SCIM API与基本身份验证一起使用来管理用户。

如果您想使用OAuth2令牌,可以像这样获得它们。

curl -k -d "grant_type=password&username=<username>&password=<password>" 
    -u <Consumer_key>:<Consumer_secret> 
    -H "Content-Type: application/x-www-form-urlencoded" 
    https://localhost:9443/oauth2/token

[1] https://docs.wso2.com/display/IS530/SCIM+1.1+APIs