clean up client sessions

This commit is contained in:
Bill Burke
2015-07-20 12:21:48 -04:00
parent 4dba4f3c02
commit 3ecd1307b0
2 changed files with 3 additions and 0 deletions

View File

@@ -444,8 +444,10 @@ public class SamlProtocol implements LoginProtocol {
@Override
public Response consentDenied(ClientSessionModel clientSession) {
if ("true".equals(clientSession.getClient().getAttribute(SAML_IDP_INITIATED_LOGIN))) {
session.sessions().removeClientSession(realm, clientSession);
return ErrorPage.error(session, Messages.CONSENT_DENIED);
} else {
session.sessions().removeClientSession(realm, clientSession);
return getErrorResponse(clientSession, JBossSAMLURIConstants.STATUS_REQUEST_DENIED.get());
}
}

View File

@@ -148,6 +148,7 @@ public class OIDCLoginProtocol implements LoginProtocol {
UriBuilder redirectUri = UriBuilder.fromUri(redirect).queryParam(OAuth2Constants.ERROR, "access_denied");
if (state != null)
redirectUri.queryParam(OAuth2Constants.STATE, state);
session.sessions().removeClientSession(realm, clientSession);
Response.ResponseBuilder location = Response.status(302).location(redirectUri.build());
return location.build();
}