Search in sources :

Example 66 with ClaimConfig

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

the class OIDCSSOConsentTestCase method updateApplication.

private void updateApplication(OIDCApplication playgroundApp, ServiceProvider serviceProvider) throws Exception {
    playgroundApp.addRequiredClaim(OIDCUtilTest.lastNameClaimUri);
    ClaimConfig claimConfig = new ClaimConfig();
    Claim claim = new Claim();
    claim.setClaimUri(OIDCUtilTest.lastNameClaimUri);
    ClaimMapping claimMapping = new ClaimMapping();
    claimMapping.setRequested(true);
    claimMapping.setLocalClaim(claim);
    claimMapping.setRemoteClaim(claim);
    claimConfig.addClaimMappings(claimMapping);
    serviceProvider.setClaimConfig(claimConfig);
    updateApplication(serviceProvider);
}
Also used : ClaimMapping(org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping) ClaimConfig(org.wso2.carbon.identity.application.common.model.xsd.ClaimConfig) Claim(org.wso2.carbon.identity.application.common.model.xsd.Claim)

Example 67 with ClaimConfig

use of org.wso2.carbon.identity.application.common.model.xsd.ClaimConfig in project identity-api-server by wso2.

the class UpdateClaimConfiguration method apply.

@Override
public void apply(ServiceProvider application, ClaimConfiguration claimApiModel) {
    if (claimApiModel != null) {
        ClaimConfig applicationClaimConfiguration = getClaimConfig(application);
        // Check if dialect is local or a custom one.
        applicationClaimConfiguration.setLocalClaimDialect(isLocalDialect(claimApiModel.getDialect()));
        // Requested claims / Claim mappings.
        applicationClaimConfiguration.setClaimMappings(getClaimMappings(claimApiModel));
        // Role claim.
        updateRoleClaimConfigs(claimApiModel.getRole(), application);
        // Subject claim.
        updateSubjectClaimConfigs(claimApiModel.getSubject(), application);
    }
}
Also used : ClaimConfig(org.wso2.carbon.identity.application.common.model.ClaimConfig)

Example 68 with ClaimConfig

use of org.wso2.carbon.identity.application.common.model.xsd.ClaimConfig in project identity-api-server by wso2.

the class UpdateClaimConfiguration method updateRoleClaimConfigs.

private void updateRoleClaimConfigs(RoleConfig roleApiModel, ServiceProvider application) {
    if (roleApiModel != null) {
        ClaimConfig claimConfig = getClaimConfig(application);
        if (roleApiModel.getClaim() != null) {
            claimConfig.setRoleClaimURI(roleApiModel.getClaim().getUri());
        }
        PermissionsAndRoleConfig permissionAndRoleConfig = getPermissionAndRoleConfig(application);
        permissionAndRoleConfig.setRoleMappings(getRoleMappings(roleApiModel));
        LocalAndOutboundAuthenticationConfig localAndOutboundConfig = getLocalAndOutboundConfig(application);
        setIfNotNull(roleApiModel.getIncludeUserDomain(), localAndOutboundConfig::setUseUserstoreDomainInRoles);
    }
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig) ClaimConfig(org.wso2.carbon.identity.application.common.model.ClaimConfig) PermissionsAndRoleConfig(org.wso2.carbon.identity.application.common.model.PermissionsAndRoleConfig)

Aggregations

ClaimConfig (org.wso2.carbon.identity.application.common.model.ClaimConfig)38 ClaimMapping (org.wso2.carbon.identity.application.common.model.ClaimMapping)28 ArrayList (java.util.ArrayList)22 ClaimConfig (org.wso2.carbon.identity.application.common.model.xsd.ClaimConfig)17 IdentityProvider (org.wso2.carbon.identity.application.common.model.IdentityProvider)14 ClaimMapping (org.wso2.carbon.identity.application.common.model.xsd.ClaimMapping)13 Claim (org.wso2.carbon.identity.application.common.model.Claim)12 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)12 IdentityProviderProperty (org.wso2.carbon.identity.application.common.model.IdentityProviderProperty)11 PreparedStatement (java.sql.PreparedStatement)10 ProvisioningConnectorConfig (org.wso2.carbon.identity.application.common.model.ProvisioningConnectorConfig)10 Claim (org.wso2.carbon.identity.application.common.model.xsd.Claim)10 ResultSet (java.sql.ResultSet)9 Test (org.testng.annotations.Test)9 PermissionsAndRoleConfig (org.wso2.carbon.identity.application.common.model.PermissionsAndRoleConfig)9 ServiceProvider (org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider)9 FederatedAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig)8 RoleMapping (org.wso2.carbon.identity.application.common.model.RoleMapping)8 LocalAndOutboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig)7 Property (org.wso2.carbon.identity.application.common.model.Property)7