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);
}
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);
}
}
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);
}
}
Aggregations