首页 文章

用户管理服务WSO2 Identity Server

提问于
浏览
1

我正在使用Wso2 Identity服务器并使用其Admin服务来创建用户 . 我的问题是那些用户无法登录系统 . 下面是libs,我们正在使用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 commons-logging commons-logging 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 回答

相关问题