KEYCLOAK-4524 possible to add identity prover mappers with same name into single identity provider

- unique name enforcement working
- test added
This commit is contained in:
Martin Hardselius committed 2017-03-03 16:40:49 +01:00
1 parent b8767d13d5
commit a0a85f62c6
3 files changed
+11 -2

No files matched your search

@@ -319,7 +319,11 @@ public class IdentityProviderResource {
}
IdentityProviderMapperModel model = RepresentationToModel.toModel(mapper);
model = realm.addIdentityProviderMapper(model);
try {
model = realm.addIdentityProviderMapper(model);
} catch (Exception e) {
return ErrorResponse.error("Failed to add mapper '" + model.getName() + "' to identity provider [" + identityProviderModel.getProviderId() + "].", Response.Status.BAD_REQUEST);
}
adminEvent.operation(OperationType.CREATE).resource(ResourceType.IDENTITY_PROVIDER_MAPPER).resourcePath(uriInfo, model.getId())
.representation(mapper).success();