Skip to content

Commit 31fa282

Browse files
authored
Merge pull request #18 from dschaafsma1/develop
ENT-5279: SSO notification seems to log 'SSONOT_FAILED' when successful
2 parents 3d1ba1c + 87e11ea commit 31fa282

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

oc-sso-notificatie/src/main/java/nl/kennisnet/services/web/controller/SsoNotificationController.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public class SsoNotificationController {
8181

8282
private static final String SSONOT_FAILED = "SSONOT_FAILED";
8383

84+
private static final String SSONOT_INITIATED = "SSONOT_INITIATED";
85+
8486
private static final String SSONOT_REDIRECT = "SSONOT_REDIRECT";
8587

8688
private static final String SSONOT_SUCCESS= "SSONOT_SUCCESS";
@@ -128,11 +130,14 @@ public void processSsoNotification(@RequestParam(required = false) String id,
128130
HttpServletRequest request, HttpServletResponse response)
129131
throws IOException {
130132

133+
// Add IdP id to logback and initiate
134+
MDC.put(IDP, String.valueOf(id));
135+
MDC.put(EVENT, SSONOT_INITIATED);
136+
131137
LOGGER.info("Request received with id ('{}') url ('{}') redirectUri ('{}') referrer ('{}') realm ('{}') " +
132138
"notificationCookie ('{}')", id, url, redirectUri, referrer, realm, notificationCookie);
133139

134-
// Add IdP id to logback and set default to failed
135-
MDC.put(IDP, String.valueOf(id));
140+
// Set default to failed
136141
MDC.put(EVENT, SSONOT_FAILED);
137142

138143
List<IdP> remoteSsoNotifications = idPProvider.getAllSsoNotifications();
@@ -158,6 +163,7 @@ public void processSsoNotification(@RequestParam(required = false) String id,
158163
URL createdUrl = determineAndVerifyURL(idp, url, referrer);
159164

160165
// Set notification cookie
166+
MDC.put(EVENT, SSONOT_SUCCESS);
161167
LOGGER.info("Setting notification Cookie ('{}') for id ('{}') with url ('{}') and realm ('{}')",
162168
COOKIE_NOTIFICATION, id, createdUrl, realm);
163169

@@ -171,7 +177,6 @@ public void processSsoNotification(@RequestParam(required = false) String id,
171177
response.sendRedirect(redirectUri);
172178
return;
173179
}
174-
MDC.put(EVENT, SSONOT_SUCCESS);
175180
EVENT_LOGGER.info("Finished without redirecting");
176181
}
177182

release/src/site/markdown/docs/2.3.8-SNAPSHOT/release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
| # | Description |
1515
|:---------|:--------------------------------------------------------------|
16-
| ENT-XXXX | |
16+
| ENT-5279 | SSO notification seems to log 'SSONOT_FAILED' when successful |
1717

1818

1919
## Configuration changes

0 commit comments

Comments
 (0)