1
votes

I am using Wso2 Identity server and using its Admin services to create Users. my problem is Those user are not Able to login to system. Below are libs, which we are using 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>

Below is my code

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
Are you trying to log into the Identity Server management console with the created user? If so, that user need to have role with login permission.pulasthi7
This link[1] may help to you. [1] docs.wso2.com/display/IS500/Role-based+PermissionsKWick
no no that user will login to OAuth application. i have assigned those roles. and permission.Brijan Elwadhi
In order to login to console you need Login permission. Can you verify whether the role that you assigned to role contains that permissionThusitha Thilina Dayaratne
HI @ThusithaThilinaDayaratne I don't want that user to be login to admin console. I want that user to be login in OAuth 2 appBrijan Elwadhi

1 Answers

1
votes

Required permission for Admin Services in WSO2 IS you can found here[1].

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