Skip to content

Commit

Permalink
fix(sso): Clear cookies on SSO redirect error (datahub-project#7088)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-radhakrishnan authored and Eric Yomi committed Feb 8, 2023
1 parent fbb0dc2 commit 66577f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions datahub-frontend/app/controllers/CentralLogoutController.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ public Result executeLogout(Http.Request request) {
return redirect(
String.format("/login?error_msg=%s",
URLEncoder.encode("Failed to sign out using Single Sign-On provider. Please contact your DataHub Administrator, "
+ "or refer to server logs for more information.", StandardCharsets.UTF_8)));
+ "or refer to server logs for more information.", StandardCharsets.UTF_8)))
.withNewSession();
}
}
return Results.redirect(DEFAULT_BASE_URL_PATH)
.withNewSession();
}
}
}
7 changes: 5 additions & 2 deletions datahub-frontend/app/controllers/SsoCallbackController.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public CompletionStage<Result> handleCallback(String protocol, Http.Request requ
log.error("Caught exception while attempting to handle SSO callback! It's likely that SSO integration is mis-configured.", e);
return Results.redirect(
String.format("/login?error_msg=%s",
URLEncoder.encode("Failed to sign in using Single Sign-On provider. Please contact your DataHub Administrator, "
+ "or refer to server logs for more information.", StandardCharsets.UTF_8)));
URLEncoder.encode(
"Failed to sign in using Single Sign-On provider. Please try again, or contact your DataHub Administrator.",
StandardCharsets.UTF_8)))
.discardingCookie("actor")
.withNewSession();
}
return res;
});
Expand Down

0 comments on commit 66577f4

Please sign in to comment.