From 12d885cb3f32a83c14a19cfc795ec36388593b93 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Fri, 11 Oct 2024 14:17:10 +0200 Subject: [PATCH] Device flow is stateless --- src/main/java/oidc/web/ErrorController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/oidc/web/ErrorController.java b/src/main/java/oidc/web/ErrorController.java index d9a4cd60..0f4d4daf 100644 --- a/src/main/java/oidc/web/ErrorController.java +++ b/src/main/java/oidc/web/ErrorController.java @@ -110,14 +110,16 @@ public Object error(HttpServletRequest request) { SavedRequest savedRequest = requestCache.getRequest(request, null); boolean redirect = false; + boolean isDeviceFlow = error instanceof DeviceFlowException; if (error instanceof ContextSaml2AuthenticationException) { ContextSaml2AuthenticationException ctxE = (ContextSaml2AuthenticationException) error; String originalRequestUrl = ctxE.getAuthenticationRequest().getOriginalRequestUrl(); UriComponents uriComponent = UriComponentsBuilder.fromUriString(originalRequestUrl).build(); redirectUri = uriComponent.getQueryParams().getFirst("redirect_uri"); redirect = true; - } else if (savedRequest == null) { + } else if (savedRequest == null && !isDeviceFlow) { LOG.warn("No saved request found. Check the cookie flow"); + } if (savedRequest instanceof DefaultSavedRequest) { parameterMap = savedRequest.getParameterMap();