diff --git a/adapters/oidc/wildfly-elytron/src/main/java/org/keycloak/adapters/elytron/ElytronHttpFacade.java b/adapters/oidc/wildfly-elytron/src/main/java/org/keycloak/adapters/elytron/ElytronHttpFacade.java index 4941275f1e..543e848d47 100644 --- a/adapters/oidc/wildfly-elytron/src/main/java/org/keycloak/adapters/elytron/ElytronHttpFacade.java +++ b/adapters/oidc/wildfly-elytron/src/main/java/org/keycloak/adapters/elytron/ElytronHttpFacade.java @@ -267,7 +267,9 @@ class ElytronHttpFacade implements OIDCHttpFacade { @Override public void setStatus(final int status) { - responseConsumer = responseConsumer.andThen(response -> response.setStatusCode(status)); + if (status < 200 || status > 300) { + responseConsumer = responseConsumer.andThen(response -> response.setStatusCode(status)); + } } @Override