Search in sources :

Example 81 with ClaimMapping

use of org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping in project product-is by wso2.

the class SAMLIdentityFederationTestCase method getClaimMappings.

private ClaimMapping[] getClaimMappings() {
    List<ClaimMapping> claimMappingList = new ArrayList<ClaimMapping>();
    Claim lastNameClaim = new Claim();
    lastNameClaim.setClaimUri(lastNameClaimURI);
    ClaimMapping lastNameClaimMapping = new ClaimMapping();
    lastNameClaimMapping.setRequested(true);
    lastNameClaimMapping.setLocalClaim(lastNameClaim);
    lastNameClaimMapping.setRemoteClaim(lastNameClaim);
    claimMappingList.add(lastNameClaimMapping);
    return claimMappingList.toArray(new ClaimMapping[claimMappingList.size()]);
}
Also used : ClaimMapping(org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping) ArrayList(java.util.ArrayList) Claim(org.wso2.carbon.identity.application.common.model.xsd.Claim)

Example 82 with ClaimMapping

use of org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping in project product-is by wso2.

the class AbstractSAMLSSOTestCase method getClaimMappings.

public ClaimMapping[] getClaimMappings() {
    List<ClaimMapping> claimMappingList = new ArrayList<ClaimMapping>();
    Claim firstNameClaim = new Claim();
    firstNameClaim.setClaimUri(firstNameClaimURI);
    ClaimMapping firstNameClaimMapping = new ClaimMapping();
    firstNameClaimMapping.setRequested(true);
    firstNameClaimMapping.setLocalClaim(firstNameClaim);
    firstNameClaimMapping.setRemoteClaim(firstNameClaim);
    claimMappingList.add(firstNameClaimMapping);
    Claim lastNameClaim = new Claim();
    lastNameClaim.setClaimUri(lastNameClaimURI);
    ClaimMapping lastNameClaimMapping = new ClaimMapping();
    lastNameClaimMapping.setRequested(true);
    lastNameClaimMapping.setLocalClaim(lastNameClaim);
    lastNameClaimMapping.setRemoteClaim(lastNameClaim);
    claimMappingList.add(lastNameClaimMapping);
    Claim emailClaim = new Claim();
    emailClaim.setClaimUri(emailClaimURI);
    ClaimMapping emailClaimMapping = new ClaimMapping();
    emailClaimMapping.setRequested(true);
    emailClaimMapping.setLocalClaim(emailClaim);
    emailClaimMapping.setRemoteClaim(emailClaim);
    claimMappingList.add(emailClaimMapping);
    return claimMappingList.toArray(new ClaimMapping[claimMappingList.size()]);
}
Also used : ClaimMapping(org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping) ArrayList(java.util.ArrayList) Claim(org.wso2.carbon.identity.application.common.model.xsd.Claim)

Example 83 with ClaimMapping

use of org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping in project product-is by wso2.

the class SAMLFederationWithFileBasedSPAndIDPTestCase method getClaimMappingsForSPInSecondaryIS.

protected ClaimMapping[] getClaimMappingsForSPInSecondaryIS() {
    ClaimMapping[] claimMappingArray = new ClaimMapping[2];
    Claim firstNameLocalClaim = new Claim();
    firstNameLocalClaim.setClaimUri(firstNameLocalClaimURI);
    Claim firstNameRemoteClaim = new Claim();
    firstNameRemoteClaim.setClaimUri(firstNameRemoteIdPClaimURI);
    ClaimMapping firstNameClaimMapping = new ClaimMapping();
    firstNameClaimMapping.setRequested(true);
    firstNameClaimMapping.setLocalClaim(firstNameLocalClaim);
    firstNameClaimMapping.setRemoteClaim(firstNameRemoteClaim);
    claimMappingArray[0] = firstNameClaimMapping;
    Claim emailLocalClaim = new Claim();
    emailLocalClaim.setClaimUri(emailLocalClaimURI);
    Claim emailRemoteClaim = new Claim();
    emailRemoteClaim.setClaimUri(emailRemoteIdPClaimURI);
    ClaimMapping emailClaimMapping = new ClaimMapping();
    emailClaimMapping.setRequested(true);
    emailClaimMapping.setLocalClaim(emailLocalClaim);
    emailClaimMapping.setRemoteClaim(emailRemoteClaim);
    claimMappingArray[1] = emailClaimMapping;
    return claimMappingArray;
}
Also used : ClaimMapping(org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping) Claim(org.wso2.carbon.identity.application.common.model.xsd.Claim)

Example 84 with ClaimMapping

use of org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping in project product-is by wso2.

the class TestPassiveSTSFederation method getLocalClaimUris.

private List<String> getLocalClaimUris(ClaimConfig updatedClaimConfig) {
    ClaimMapping[] claimMappings = updatedClaimConfig.getClaimMappings();
    List<String> localClaimUris = new ArrayList<>();
    for (ClaimMapping claimMapping : claimMappings) {
        localClaimUris.add(claimMapping.getLocalClaim().getClaimUri());
    }
    return localClaimUris;
}
Also used : ClaimMapping(org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping) ArrayList(java.util.ArrayList)

Example 85 with ClaimMapping

use of org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping in project product-is by wso2.

the class TestPassiveSTSFederation method getClaimMappings.

private ClaimMapping[] getClaimMappings() {
    List<ClaimMapping> claimMappingList = new ArrayList<ClaimMapping>();
    Claim givenNameClaim = new Claim();
    givenNameClaim.setClaimUri(givenNameClaimURI);
    ClaimMapping givenNameClaimMapping = new ClaimMapping();
    givenNameClaimMapping.setRequested(true);
    givenNameClaimMapping.setLocalClaim(givenNameClaim);
    givenNameClaimMapping.setRemoteClaim(givenNameClaim);
    claimMappingList.add(givenNameClaimMapping);
    Claim emailClaim = new Claim();
    emailClaim.setClaimUri(emailClaimURI);
    ClaimMapping emailClaimMapping = new ClaimMapping();
    emailClaimMapping.setRequested(true);
    emailClaimMapping.setLocalClaim(emailClaim);
    emailClaimMapping.setRemoteClaim(emailClaim);
    claimMappingList.add(emailClaimMapping);
    return claimMappingList.toArray(new ClaimMapping[claimMappingList.size()]);
}
Also used : ClaimMapping(org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping) ArrayList(java.util.ArrayList) Claim(org.wso2.carbon.identity.application.common.model.xsd.Claim)

Aggregations

ClaimMapping (org.wso2.carbon.identity.application.common.model.ClaimMapping)108 HashMap (java.util.HashMap)60 ArrayList (java.util.ArrayList)52 ClaimConfig (org.wso2.carbon.identity.application.common.model.ClaimConfig)27 Map (java.util.Map)26 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)24 ClaimMapping (org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping)24 ClaimMapping (org.wso2.carbon.user.api.ClaimMapping)24 Claim (org.wso2.carbon.identity.application.common.model.Claim)23 Test (org.testng.annotations.Test)22 Claim (org.wso2.carbon.identity.application.common.model.xsd.Claim)21 LocalClaim (org.wso2.carbon.identity.claim.metadata.mgt.model.LocalClaim)21 AuthenticatedUser (org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser)20 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)20 List (java.util.List)17 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)17 UserStoreException (org.wso2.carbon.user.api.UserStoreException)17 Matchers.anyString (org.mockito.Matchers.anyString)16 IdentityProvider (org.wso2.carbon.identity.application.common.model.IdentityProvider)13 ClaimMetadataException (org.wso2.carbon.identity.claim.metadata.mgt.exception.ClaimMetadataException)13