Skip to content

Commit

Permalink
Update OAuthRevokeServlet.java
Browse files Browse the repository at this point in the history
  • Loading branch information
michalskrivanek committed Oct 4, 2022
1 parent f4ecaa3 commit c66bace
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public static void cleanupSsoSession(
if (ssoContext.getSsoLocalConfig().getBoolean("ENGINE_SSO_ENABLE_EXTERNAL_SSO")) {
log.debug("Existing Session found for token: {}, refresh_token: {}, invalidating session on external OP",
ssoSession.getAccessToken(), refreshToken);
ExternalOIDCService.logout(ssoContext, refreshToken);
if (refreshToken != null) {
ExternalOIDCService.logout(ssoContext, refreshToken);
}
}
invokeAuthnLogout(ssoContext, ssoSession);
SsoService.notifyClientsOfLogoutEvent(ssoContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ public void init(ServletConfig config) throws ServletException {
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
log.debug("Entered OAuthRevokeServlet QueryString: {}, Parameters : {}, refresh_token: {}",
log.debug("Entered OAuthRevokeServlet QueryString: {}, Parameters : {}",
request.getQueryString(),
SsoService.getRequestParameters(request),
ssoSession.getRefreshToken());
SsoService.getRequestParameters(request));

try {
String token = SsoService.getRequestParameter(request, SsoConstants.HTTP_PARAM_TOKEN);
Expand All @@ -48,6 +47,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response)

SsoSession ssoSession = ssoContext.getSsoSession(token);
if (ssoSession != null) {
log.debug("refresh_token: {}", ssoSession.getRefreshToken());
Set<String> associatedClientIds = new TreeSet<>(ssoSession.getAssociatedClientIds());
boolean revokeAllScope = SsoService.scopeAsList(scope).contains("ovirt-ext=revoke:revoke-all");
if (revokeAllScope) {
Expand Down

0 comments on commit c66bace

Please sign in to comment.