diff --git a/manage-server/src/main/java/manage/service/MetaDataService.java b/manage-server/src/main/java/manage/service/MetaDataService.java index df318c62..36c6e300 100644 --- a/manage-server/src/main/java/manage/service/MetaDataService.java +++ b/manage-server/src/main/java/manage/service/MetaDataService.java @@ -498,15 +498,15 @@ public void createConnectWithoutInteraction(Map connectionData, boolean connectWithoutInteraction = StringUtils.hasText(dashboardConnectType) && DashboardConnectOption.fromType(dashboardConnectType).connectWithoutInteraction(); - Object idpInstitutionId = idp.metaDataFields().get("coin:institution_id"); - Object spInstitutionId = sp.metaDataFields().get("coin:institution_id"); + Object idpInstitutionId = idp.metaDataFields().get("coin:institution_guid"); + Object spInstitutionId = sp.metaDataFields().get("coin:institution_guid"); boolean shareInstitutionId = idpInstitutionId != null && idpInstitutionId.equals(spInstitutionId) && !"connect_with_interaction".equals(dashboardConnectType); if (!connectWithoutInteraction && !shareInstitutionId) { throw new EndpointNotAllowed( - String.format("SP %s does not allow an automatic connection with IdP %s. " + + String.format("%s %s does not allow an automatic connection with IdP %s. " + "SP dashboardConnectType: %s, idpInstitutionId: %s, spInstitutionId %s", - spEntityId, idpEntityId, dashboardConnectType, idpInstitutionId, spInstitutionId)); + spType, spEntityId, idpEntityId, dashboardConnectType, idpInstitutionId, spInstitutionId)); } addAllowedEntity(sp, idpEntityId, connectionData, apiUser, false); diff --git a/manage-server/src/test/java/manage/control/MetaDataControllerTest.java b/manage-server/src/test/java/manage/control/MetaDataControllerTest.java index 2e5ae8c1..84027fd7 100644 --- a/manage-server/src/test/java/manage/control/MetaDataControllerTest.java +++ b/manage-server/src/test/java/manage/control/MetaDataControllerTest.java @@ -1212,7 +1212,7 @@ public void connectValidSpWithoutInteraction() { } @Test - public void connectSpWithSameInstitutionIdAsIdp() { + public void connectSpWithSameInstitutionGUIDAsIdp() { String idpEntityId = "https://idp.test2.surfconext.nl"; String idUId = "6"; String rpId = "https@//oidc.rp"; diff --git a/manage-server/src/test/resources/json/meta_data_seed.json b/manage-server/src/test/resources/json/meta_data_seed.json index 2fae1a8e..eca4d397 100644 --- a/manage-server/src/test/resources/json/meta_data_seed.json +++ b/manage-server/src/test/resources/json/meta_data_seed.json @@ -516,7 +516,7 @@ "refreshTokenValidity": 3600, "coin:stepup:requireloa": "http://test.surfconext.nl/assurance/loa3", "coin:stepup:allow_no_token": true, - "coin:institution_guid": "8D64131A-5ABA-4223-9E8D-DF7B8C516CE8" + "coin:institution_guid": "219092BE-B234-4C17-B910-B090C19CE3DB" } } }, diff --git a/manage-server/src/test/resources/push/push.expected_connections.json b/manage-server/src/test/resources/push/push.expected_connections.json index 6c598d85..b6debb05 100644 --- a/manage-server/src/test/resources/push/push.expected_connections.json +++ b/manage-server/src/test/resources/push/push.expected_connections.json @@ -513,7 +513,7 @@ "disable_scoping": "1", "guest_qualifier": "All", "hidden": "1", - "institution_id": "123", + "institution_guid": "219092BE-B234-4C17-B910-B090C19CE3DB", "publish_in_edugain": "1", "publish_in_edugain_date": "2018-06-15T08:20:34.575Z", "schachomeorganization": "schac_home" @@ -662,7 +662,7 @@ } ], "coin": { - "institution_id": "123", + "institution_guid": "219092BE-B234-4C17-B910-B090C19CE3DB", "stepup": { "allow_no_token": "1", "requireloa": "http://test.surfconext.nl/assurance/loa3"