[KEYCLOAK-11219] log an explicit error message when state is null

This commit is contained in:
Cédric Couralet 2019-08-28 13:19:45 +02:00 committed by Marek Posolda
parent 71e6fc2b30
commit aadd5331bc

View file

@ -102,6 +102,14 @@ public class OIDCIdentityProvider extends AbstractOAuth2IdentityProvider<OIDCIde
@GET
@Path("logout_response")
public Response logoutResponse(@QueryParam("state") String state) {
if (state == null){
logger.error("no state parameter returned");
EventBuilder event = new EventBuilder(realm, session, clientConnection);
event.event(EventType.LOGOUT);
event.error(Errors.USER_SESSION_NOT_FOUND);
return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.IDENTITY_PROVIDER_UNEXPECTED_ERROR);
}
UserSessionModel userSession = session.sessions().getUserSession(realm, state);
if (userSession == null) {
logger.error("no valid user session");