简体   繁体   English

如何以编程方式将用户添加到wso2密钥管理器?

[英]How to add users programmatically to wso2 key manager?

I'm using wso2 API Manager with the default key manager. 我将wso2 API Manager与默认密钥管理器一起使用。 I'm not using Identity Server (IS) in the setup. 我没有在安装程序中使用Identity Server(IS)。

I have read that Identity Server (IS) provides SCIM Apis to add users programmatically. 我已经读过Identity Server(IS)提供了SCIM Apis来以编程方式添加用户。 Is it possible to do the same, without IS? 没有IS,是否可以这样做?

I would expect that 1) an application should be able to register a new user (with username and password) to Key Manager 2) the application should call the /token service in order to get the token, using username, password and Basic Authentication with the API key I have provided. 我希望1)应用程序应该能够向密钥管理器注册新用户(使用用户名和密码)2)应用程序应该调用/ token服务以使用用户名,密码和基本身份验证来获取令牌我提供的API密钥。

From your request I assume you are using WSO2 APIM (you may be specific in your questions) 根据您的请求,我假设您正在使用WSO2 APIM(您可能会在问题中有所提及)

I have read that Identity Server (IS) provides SCIM Apis to add users programmatically. 我已经读过Identity Server(IS)提供了SCIM Apis来以编程方式添加用户。 Is it possible without IS? 没有IS是否有可能?

As far I know the SCIM is provided by an identity server (short answer - no), but there are other options you may have to achieve your goals 据我所知,SCIM是由身份服务器提供的(简短答案-否),但是要实现目标,您可能还需要其他选择

I would expect that 1) an application should be able to register a new user (with username and password) to Key Manager 我希望1)应用程序应该能够向密钥管理器注册一个新用户(使用用户名和密码)

  1. You could manage users with underlying userstore (LDAP, ...) 您可以使用基础用户存储(LDAP等)管理用户
  2. You can use Admin Services , see eg RemoteUserStoreManagerService (I'd recommend this option if you are using the build-in jdbc userstore) 您可以使用Admin Services ,例如,请参见RemoteUserStoreManagerService(如果您使用内置的jdbc用户存储,建议您使用此选项)

2) the application should call the /token service in order to get the token, using username, password and Basic Authentication with the API key I have provided. 2)应用程序应使用用户名,密码和带有我提供的API密钥的基本身份验证来调用/ token服务以获取令牌。

To get a user token with user credentials you may use OAuth2 password grant type . 要获取具有用户凭证的用户令牌,可以使用OAuth2密码授予类型

IMHO - instead of sending application credentials as basic authentication I suggest to follow pure OAuth2 specification and send the application credentials as parameters (client_id, client_secret). 恕我直言-我建议不要遵循纯OAuth2规范,而是将应用程序凭据作为参数(client_id,client_secret)发送,而不是将应用程序凭据作为基本身份验证发送。 WSO2 supports this option too and this way you stay more aligned to standards (supporting other products/services if needed). WSO2也支持此选项,这样您就可以与标准保持更加一致(如果需要,可以支持其他产品/服务)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM