2012-08-08 54 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"); 
相關問題