2012-08-08 29 views
3

我正尝试在UserStoreManager中使用WSO2身份服务器添加用户帐户。我没有问题,将用户添加一个要求值或没有,但当我尝试在权利要求中地图中添加多个要求值,它抛出我的异常:WSO2 Identity Server无法通过API添加具有多个声明值的用户

org.wso2.carbon.um.ws.api.WSUserStoreManager handleException 
SEVERE: Can not access the directory context oruser already exists in the system 
org.apache.axis2.AxisFault: Can not access the directory context oruser already exists in the system.. 

这是我的代码使用

Map<String, String> claims = new HashMap<String, String>(); 
claims.put("http://wso2.org/claims/givenname", "John"); 
//second value causing the exception 
claims.put("http://wso2.org/claims/lastname", "Doe"); 
STORE_MANAGER.addUser("JohnDoe", "123456", 
     new String[] { Constants.DEFAULT_ROLE }, claims, "default"); 

回答

1

什么是您使用的IS版本?

顺便说一句,请试试这个

Map<String, String> claims = new HashMap<String, String>(); 

claims.put("http://wso2.org/claims/givenname", "John"); 

claims.put("http://wso2.org/claims/lastname", "Doe"); 

remoteUserStoreManager.addUser("JohnDoe", "123456",null, claims, "default"); 
相关问题