Skip to content

Commit

Permalink
Device flow is stateless
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Oct 11, 2024
1 parent 5348cf7 commit 12d885c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/oidc/web/ErrorController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 12d885c

Please sign in to comment.