Here is the log.
failedlogin.log (32.9 KB)
What I see is that while I am doing the authentication, I have a line that says “Saved request http://localhost:8080/VAADIN/push?v-r=push&debug_window&continue to session” Could that overwrite the initial return URL initially set to “Saved request http://localhost:8080/?continue to session” (Is it a timing issue, because I login slower than you? )
This is when I go back to localhost:8080 (while I have a keycloak session opened)
2023-12-22T15:14:45.643+01:00 DEBUG 135356 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : Securing GET /
2023-12-22T15:14:45.643+01:00 DEBUG 135356 --- [nio-8080-exec-2] o.s.s.w.a.AnonymousAuthenticationFilter : Set SecurityContextHolder to anonymous SecurityContext
2023-12-22T15:14:45.644+01:00 DEBUG 135356 --- [nio-8080-exec-2] o.s.s.w.s.HttpSessionRequestCache : Saved request http://localhost:8080/?continue to session
2023-12-22T15:14:45.644+01:00 DEBUG 135356 --- [nio-8080-exec-2] s.w.a.DelegatingAuthenticationEntryPoint : Trying to match using And [Not [RequestHeaderRequestMatcher [expectedHeaderName=X-Requested-With, expectedHeaderValue=XMLHttpRequest]], Not [And [Or [Ant [pattern='/login'], Ant [pattern='/favicon.ico']], And [Not [RequestHeaderRequestMatcher [expectedHeaderName=X-Requested-With, expectedHeaderValue=XMLHttpRequest]], MediaTypeRequestMatcher [contentNegotiationStrategy=org.springframework.web.accept.ContentNegotiationManager@3a4be062, matchingMediaTypes=[application/xhtml+xml, image/*, text/html, text/plain], useEquals=false, ignoredMediaTypes=[*/*]]]]], org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer$$Lambda$1364/0x00007febdcb03c88@3b288724]
2023-12-22T15:14:45.644+01:00 DEBUG 135356 --- [nio-8080-exec-2] s.w.a.DelegatingAuthenticationEntryPoint : Match found! Executing org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint@577c9a0e
2023-12-22T15:14:45.644+01:00 DEBUG 135356 --- [nio-8080-exec-2] o.s.s.web.DefaultRedirectStrategy : Redirecting to http://localhost:8080/oauth2/authorization/keycloak
2023-12-22T15:14:45.652+01:00 DEBUG 135356 --- [io-8080-exec-10] o.s.security.web.FilterChainProxy : Securing GET /oauth2/authorization/keycloak
2023-12-22T15:14:45.653+01:00 DEBUG 135356 --- [io-8080-exec-10] o.s.s.web.DefaultRedirectStrategy : Redirecting to https://mykeycloak.mydomain.com:8443/realms/oidcDemo/protocol/openid-connect/auth?response_type=code&client_id=jmix&scope=openid%20profile%20email&state=u0hUpXlWrhlHuz5x-PHmng0zbh3ksm2_KodvRRaHfOM%3D&redirect_uri=http://localhost:8080/login/oauth2/code/keycloak&nonce=WcTrMKu9w09SR4Cxq96tu1fshXd5Ld6ejUUOgWYVJDE
2023-12-22T15:14:45.685+01:00 DEBUG 135356 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : Securing GET /login/oauth2/code/keycloak?state=u0hUpXlWrhlHuz5x-PHmng0zbh3ksm2_KodvRRaHfOM%3D&session_state=1aa0b14a-237e-4213-baa5-5c7c5547012e&iss=https%3A%2F%2Fmykeycloak.mydomain.com%3A8443%2Frealms%2FoidcDemo&code=38770c6d-b27e-485b-967c-c38b06759bea.1aa0b14a-237e-4213-baa5-5c7c5547012e.5c8018bf-2430-4bdb-95ba-659185e2fd55
2023-12-22T15:14:45.842+01:00 WARN 135356 --- [nio-8080-exec-1] i.j.o.c.BaseClaimsRolesMapper : Resource role default-roles-oidcdemo not found
2023-12-22T15:14:45.847+01:00 WARN 135356 --- [nio-8080-exec-1] i.j.o.c.BaseClaimsRolesMapper : Resource role offline_access not found
2023-12-22T15:14:45.852+01:00 WARN 135356 --- [nio-8080-exec-1] i.j.o.c.BaseClaimsRolesMapper : Resource role uma_authorization not found
2023-12-22T15:14:45.857+01:00 WARN 135356 --- [nio-8080-exec-1] i.j.o.c.BaseClaimsRolesMapper : Row-level role system-full-access not found
2023-12-22T15:14:45.861+01:00 WARN 135356 --- [nio-8080-exec-1] i.j.o.c.BaseClaimsRolesMapper : Row-level role default-roles-oidcdemo not found
2023-12-22T15:14:45.865+01:00 WARN 135356 --- [nio-8080-exec-1] i.j.o.c.BaseClaimsRolesMapper : Row-level role offline_access not found
2023-12-22T15:14:45.869+01:00 WARN 135356 --- [nio-8080-exec-1] i.j.o.c.BaseClaimsRolesMapper : Row-level role uma_authorization not found
2023-12-22T15:14:45.870+01:00 DEBUG 135356 --- [nio-8080-exec-1] o.s.s.core.session.SessionRegistryImpl : Registering session D9DED300C2910C05F4BC89F87B7CC222, for principal io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1
2023-12-22T15:14:45.871+01:00 DEBUG 135356 --- [nio-8080-exec-1] o.s.s.core.session.SessionRegistryImpl : Removing session D9DED300C2910C05F4BC89F87B7CC222 from principal's set of registered sessions
2023-12-22T15:14:45.871+01:00 DEBUG 135356 --- [nio-8080-exec-1] o.s.s.core.session.SessionRegistryImpl : Removing principal io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1 from registry
2023-12-22T15:14:45.871+01:00 DEBUG 135356 --- [nio-8080-exec-1] o.s.s.core.session.SessionRegistryImpl : Registering session D9DED300C2910C05F4BC89F87B7CC222, for principal io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1
2023-12-22T15:14:45.871+01:00 DEBUG 135356 --- [nio-8080-exec-1] w.c.HttpSessionSecurityContextRepository : Stored SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]] to HttpSession [org.apache.catalina.session.StandardSessionFacade@ed9609d]
2023-12-22T15:14:45.871+01:00 DEBUG 135356 --- [nio-8080-exec-1] .s.o.c.w.OAuth2LoginAuthenticationFilter : Set SecurityContextHolder to OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]
2023-12-22T15:14:45.871+01:00 DEBUG 135356 --- [nio-8080-exec-1] o.s.s.web.DefaultRedirectStrategy : Redirecting to http://localhost:8080/?continue
2023-12-22T15:14:45.879+01:00 DEBUG 135356 --- [nio-8080-exec-3] o.s.security.web.FilterChainProxy : Securing GET /?continue
2023-12-22T15:14:45.880+01:00 DEBUG 135356 --- [nio-8080-exec-3] o.s.s.w.s.HttpSessionRequestCache : Loaded matching saved request http://localhost:8080/?continue
2023-12-22T15:14:45.881+01:00 DEBUG 135356 --- [nio-8080-exec-3] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]
2023-12-22T15:14:45.881+01:00 DEBUG 135356 --- [nio-8080-exec-3] o.s.security.web.FilterChainProxy : Secured GET /?continue
2023-12-22T15:14:45.924+01:00 DEBUG 135356 --- [nio-8080-exec-4] o.s.security.web.FilterChainProxy : Securing POST /?v-r=uidl&v-uiId=0
2023-12-22T15:14:45.925+01:00 DEBUG 135356 --- [nio-8080-exec-4] o.s.security.web.FilterChainProxy : Secured POST /?v-r=uidl&v-uiId=0
2023-12-22T15:14:45.925+01:00 DEBUG 135356 --- [nio-8080-exec-4] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]
2023-12-22T15:14:45.947+01:00 DEBUG 135356 --- [nio-8080-exec-6] o.s.security.web.FilterChainProxy : Securing GET /VAADIN/push?v-r=push&debug_window
2023-12-22T15:14:45.948+01:00 DEBUG 135356 --- [nio-8080-exec-6] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]
2023-12-22T15:14:45.948+01:00 DEBUG 135356 --- [nio-8080-exec-6] o.s.security.web.FilterChainProxy : Secured GET /VAADIN/push?v-r=push&debug_window
2023-12-22T15:14:45.954+01:00 DEBUG 135356 --- [nio-8080-exec-5] o.s.security.web.FilterChainProxy : Securing GET /?v-r=init&location=&query=continue
2023-12-22T15:14:45.954+01:00 DEBUG 135356 --- [nio-8080-exec-5] o.s.security.web.FilterChainProxy : Secured GET /?v-r=init&location=&query=continue
2023-12-22T15:14:45.954+01:00 DEBUG 135356 --- [nio-8080-exec-5] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]
2023-12-22T15:14:46.043+01:00 DEBUG 135356 --- [nio-8080-exec-3] o.s.security.web.FilterChainProxy : Securing GET /VAADIN/static/push/vaadinPush.js?v=24.1.12
2023-12-22T15:14:46.043+01:00 DEBUG 135356 --- [nio-8080-exec-3] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]
2023-12-22T15:14:46.043+01:00 DEBUG 135356 --- [nio-8080-exec-3] o.s.security.web.FilterChainProxy : Secured GET /VAADIN/static/push/vaadinPush.js?v=24.1.12
2023-12-22T15:14:46.302+01:00 DEBUG 135356 --- [nio-8080-exec-4] o.s.security.web.FilterChainProxy : Securing POST /?v-r=uidl&v-uiId=1
2023-12-22T15:14:46.302+01:00 DEBUG 135356 --- [nio-8080-exec-5] o.s.security.web.FilterChainProxy : Securing GET /VAADIN/push?v-r=push&v-uiId=1&v-pushId=569a2206-649b-4531-b0fd-6c00ff39f041&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=3.1.2-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json;%20charset=UTF-8&X-atmo-protocol=true&X-Vaadin-LastSeenServerSyncId=0
2023-12-22T15:14:46.303+01:00 DEBUG 135356 --- [nio-8080-exec-4] o.s.security.web.FilterChainProxy : Secured POST /?v-r=uidl&v-uiId=1
2023-12-22T15:14:46.303+01:00 DEBUG 135356 --- [nio-8080-exec-5] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]
2023-12-22T15:14:46.303+01:00 DEBUG 135356 --- [nio-8080-exec-4] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]
2023-12-22T15:14:46.303+01:00 DEBUG 135356 --- [nio-8080-exec-5] o.s.security.web.FilterChainProxy : Secured GET /VAADIN/push?v-r=push&v-uiId=1&v-pushId=569a2206-649b-4531-b0fd-6c00ff39f041&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=3.1.2-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json;%20charset=UTF-8&X-atmo-protocol=true&X-Vaadin-LastSeenServerSyncId=0
2023-12-22T15:14:46.320+01:00 DEBUG 135356 --- [nio-8080-exec-8] o.s.security.web.FilterChainProxy : Securing POST /?v-r=uidl&v-uiId=1
2023-12-22T15:14:46.320+01:00 DEBUG 135356 --- [nio-8080-exec-8] o.s.security.web.FilterChainProxy : Secured POST /?v-r=uidl&v-uiId=1
2023-12-22T15:14:46.320+01:00 DEBUG 135356 --- [nio-8080-exec-8] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]
2023-12-22T15:14:46.554+01:00 DEBUG 135356 --- [io-8080-exec-10] o.s.security.web.FilterChainProxy : Securing POST /?v-r=uidl&v-uiId=1
2023-12-22T15:14:46.555+01:00 DEBUG 135356 --- [io-8080-exec-10] o.s.security.web.FilterChainProxy : Secured POST /?v-r=uidl&v-uiId=1
2023-12-22T15:14:46.555+01:00 DEBUG 135356 --- [io-8080-exec-10] w.c.HttpSessionSecurityContextRepository : Retrieved SecurityContextImpl [Authentication=OAuth2AuthenticationToken [Principal=io.jmix.oidc.user.DefaultJmixOidcUser@3b5354c1, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=D9DED300C2910C05F4BC89F87B7CC222], Granted Authorities=[ROLE_system-full-access]]]