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();