用户管理服务WSO2 Identity Server

时间:2017-01-05 14:22:19

标签: wso2 axis2 wso2is wsdl2java

我正在使用Wso2 Identity服务器并使用其Admin服务来创建用户。我的问题是那些用户无法登录系统。 下面是我们正在使用的库                  org.wso2.carbon.identity.framework             org.wso2.carbon.identity.mgt.stub             5.6.14                               org.wso2.carbon             org.wso2.carbon.utils             4.4.10                                                   的Xerces                     xercesImpl                                                       Jaxen的                     xercesImpl                                                       com.ibm.icu                     ICU4J                                                             org.wso2.carbon.identity.user.ws             org.wso2.carbon.um.ws.api.stub             5.1.3                                                   共享记录                     共享记录                                                             org.wso2.carbon.identity.framework             org.wso2.carbon.identity.user.registration.stub             5.6.14                               org.wso2.carbon.identity.framework             org.wso2.carbon.user.mgt.stub             5.6.14         

    <dependency>
        <groupId>org.apache.axis2.wso2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.6.1.wso2v12</version>
    </dependency>
    <dependency>
        <groupId>org.apache.ws.commons.axiom.wso2</groupId>
        <artifactId>axiom</artifactId>
        <version>1.2.11.wso2v10</version>
    </dependency>
    <!-- <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> 
        </dependency> -->
    <dependency>
        <groupId>org.wso2.carbon.identity.framework</groupId>
        <artifactId>org.wso2.carbon.identity.user.profile.stub</artifactId>
        <version>5.6.14</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.wso2.carbon.identity.agent.sso.java</groupId>
        <artifactId>org.wso2.carbon.identity.sso.agent</artifactId>
        <version>5.1.3</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.wso2.orbit.org.opensaml</groupId>
                <artifactId>opensaml</artifactId>
            </exclusion>
        </exclusions>
    </dependency>


    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-spring</artifactId>
        <version>1.6.1-wso2v12</version>
    </dependency>

    <dependency>
        <groupId>org.wso2.orbit.org.opensaml</groupId>
        <artifactId>opensaml</artifactId>
        <version>2.6.4.wso2v3</version>
    </dependency>

以下是我的代码

String[] roles = {"Application/myOAunth", "Internal/everyone"};
    ClaimValue sub = new ClaimValue();
    sub.setClaimURI("sub");
    sub.setValue(userSignUpRequest.getFirstName());
    ClaimValue fullName = new ClaimValue();
    fullName.setClaimURI("http://wso2.org/claims/fullname");
    fullName.setValue(userSignUpRequest.getFirstName() + " " + userSignUpRequest.getLastName());
    ClaimValue firstName = new ClaimValue();
    firstName.setClaimURI("http://wso2.org/claims/givenname");
    firstName.setValue(userSignUpRequest.getFirstName());
    ClaimValue email = new ClaimValue();
    email.setClaimURI(" http://wso2.org/claims/emailaddress");
    email.setValue(userSignUpRequest.getFirstName());
    ClaimValue accountDisabled = new ClaimValue();
    accountDisabled.setClaimURI("http://wso2.org/claims/identity/accountDisabled");
    accountDisabled.setValue("false");
    ClaimValue[] claims = {fullName, sub, accountDisabled, firstName};
    try {
      admin.addUser(userSignUpRequest.getEmailId(), userSignUpRequest.getPassword(), roles, claims, "default");
    } catch (AxisFault e) {
      throw new GenericException(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value());
    }

1 个答案:

答案 0 :(得分:1)

WSO2 IS 中管理服务所需的权限,您可以在此处找到[1]。

[1] https://docs.wso2.com/display/IS510/Permissions+Required+to+Invoke+Admin+Services