Search in sources :

Example 96 with ClaimValue

use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project product-is by wso2.

the class OAuth2ServiceAuthCodeGrantOpenIdRequestObjectTestCase method getClaimValue.

private ClaimValue getClaimValue(String claimURL, String claimVal) {
    ClaimValue claim = new ClaimValue();
    claim.setClaimURI(claimURL);
    claim.setValue(claimVal);
    return claim;
}
Also used : ClaimValue(org.wso2.carbon.um.ws.api.stub.ClaimValue)

Example 97 with ClaimValue

use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project product-is by wso2.

the class OAuth2ServiceAuthCodeGrantOpenIdTestCase method getUserClaims.

protected ClaimValue[] getUserClaims() {
    ClaimValue[] claimValues = new ClaimValue[1];
    ClaimValue email = new ClaimValue();
    email.setClaimURI(emailClaimURI);
    email.setValue(USER_EMAIL);
    claimValues[0] = email;
    return claimValues;
}
Also used : ClaimValue(org.wso2.carbon.um.ws.api.stub.ClaimValue)

Example 98 with ClaimValue

use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project product-is by wso2.

the class OAuth2ServiceResourceOwnerTestCase method createLockedUser.

private void createLockedUser(String username, String password) {
    log.info("Creating User " + username);
    ClaimValue[] claimValues = new ClaimValue[1];
    // Need to add this claim and have the value true in order to test the fix
    ClaimValue accountLockClaim = new ClaimValue();
    accountLockClaim.setClaimURI(ACCOUNT_LOCK_CLAIM_URI);
    accountLockClaim.setValue(Boolean.TRUE.toString());
    claimValues[0] = accountLockClaim;
    try {
        remoteUSMServiceClient.addUser(username, password, null, claimValues, null, false);
    } catch (Exception e) {
        Assert.fail("Error while creating the user", e);
    }
}
Also used : ClaimValue(org.wso2.carbon.um.ws.api.stub.ClaimValue)

Example 99 with ClaimValue

use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project product-is by wso2.

the class OpenIDSSOTestCase method createUser.

@BeforeMethod
public void createUser() {
    OpenIDUtils.User user = config.getUser();
    log.info("Creating User " + user.getUsername());
    ClaimValue[] claimValues = new ClaimValue[2];
    ClaimValue firstName = new ClaimValue();
    firstName.setClaimURI(firstNameClaimURI);
    firstName.setValue(user.getUsername());
    claimValues[1] = firstName;
    ClaimValue email = new ClaimValue();
    email.setClaimURI(emailClaimURI);
    email.setValue(user.getEmail());
    claimValues[0] = email;
    try {
        // creating the user
        remoteUSMServiceClient.addUser(user.getUsername(), user.getPassword(), new String[] { user.getRole() }, claimValues, profileName, true);
    } catch (Exception e) {
        Assert.fail("Error while creating the user", e);
    }
}
Also used : ClaimValue(org.wso2.carbon.um.ws.api.stub.ClaimValue) IOException(java.io.IOException) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 100 with ClaimValue

use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project product-is by wso2.

the class OpenIDUserProfileTestCase method createUser.

public void createUser() throws Exception {
    ClaimValue email = new ClaimValue();
    email.setClaimURI(emailClaimURI);
    email.setValue(emailClaimValue);
    claimValues[0] = email;
    ClaimValue firstName = new ClaimValue();
    firstName.setClaimURI(firstNameClaimURI);
    firstName.setValue(firstNameClaimValue);
    claimValues[1] = firstName;
    ClaimValue lastName = new ClaimValue();
    lastName.setClaimURI(lastNameClaimURI);
    lastName.setValue(lastNameClaimValue);
    claimValues[2] = lastName;
    ClaimValue country = new ClaimValue();
    country.setClaimURI(countryClaimURI);
    country.setValue(countryClaimValue);
    claimValues[3] = country;
    // creating the user
    RemoteUserStoreManagerServiceClient remoteUSMServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
    remoteUSMServiceClient.addUser(userName, password, roles, claimValues, profileName, true);
}
Also used : ClaimValue(org.wso2.carbon.um.ws.api.stub.ClaimValue) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)

Aggregations

ClaimValue (org.wso2.carbon.um.ws.api.stub.ClaimValue)23 HashMap (java.util.HashMap)21 Test (org.testng.annotations.Test)19 UserStoreException (org.wso2.carbon.user.core.UserStoreException)14 ISIntegrationTest (org.wso2.identity.integration.common.utils.ISIntegrationTest)14 Map (java.util.Map)13 ArrayList (java.util.ArrayList)11 RemoteException (java.rmi.RemoteException)9 RegistryException (org.wso2.carbon.registry.core.exceptions.RegistryException)9 UserStoreException (org.wso2.carbon.user.api.UserStoreException)9 ClaimValue (org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue)9 IdentityException (org.wso2.carbon.identity.base.IdentityException)8 WorkflowAdminServiceWorkflowException (org.wso2.carbon.identity.workflow.mgt.stub.WorkflowAdminServiceWorkflowException)8 Association (org.wso2.carbon.identity.workflow.mgt.stub.metadata.Association)8 Matchers.anyString (org.mockito.Matchers.anyString)7 FlaggedName (org.wso2.carbon.user.mgt.stub.types.carbon.FlaggedName)7 UserStoreManager (org.wso2.carbon.user.core.UserStoreManager)6 AuthenticatedUser (org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser)5 ClaimValue (org.wso2.carbon.user.mgt.common.ClaimValue)5 HashSet (java.util.HashSet)4