Skip to content

Commit dc7e678

Browse files
sberyozkinCopilot
andauthored
Update runtime/src/main/java/io/quarkus/oidc/proxy/runtime/OidcProxy.java
Co-authored-by: Copilot <[email protected]>
1 parent 1eff637 commit dc7e678

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

runtime/src/main/java/io/quarkus/oidc/proxy/runtime/OidcProxy.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ public void localAuthorizationCodeFlowRedirect(RoutingContext context) {
255255
return;
256256
}
257257
String oidcProxyState = OidcUtils.removeCookie(context, oidcTenantConfig, OIDC_PROXY_STATE_COOKIE);
258+
if (oidcProxyState == null) {
259+
LOG.error("Proxy state cookie is missing or could not be retrieved");
260+
context.response().setStatusCode(HttpResponseStatus.UNAUTHORIZED.code());
261+
context.response().end();
262+
return;
263+
}
258264
if (!oidcProxyState.equals(state)) {
259265
LOG.error("State query parameter is not equal to the proxy state");
260266
context.response().setStatusCode(HttpResponseStatus.UNAUTHORIZED.code());

0 commit comments

Comments
 (0)