Authentication Issue when installing LEOS on a server
SUMMARY
Hello,
I've encountered an issue with my server running LEOS. Everything was functioning properly until I pulled from the main repository last week. Now, I'm unable to access it from external devices. While it still works fine on localhost, attempting to access LEOS from an external device prompts a message stating that my session has expired: 'Your session has expired. Please reload the page to continue. Any unsaved changes will be lost.' Upon inspecting the browser console, I found the following error message: 'Http failure response for http://***/leos-pilot/api/secured/config: 500 Server Error.
Error log on the server:
00:05:07.796 [ERROR] e.e.ec.leos.security.JwtTokenService .isTokenValid:247 - Error occurred while token validation. Error: The token was expected to have 3 parts, but got 1. 00:05:07.797 [WARN ] e.e.e.l.a.a.LeosApiAuthenticationFilter .attemptAuthentication:61 - Authorization failed! Wrong accessToken [WARNING] /leos-pilot/api/secured/users/current com.auth0.jwt.exceptions.JWTDecodeException: The token was expected to have 3 parts, but got 1. at com.auth0.jwt.TokenUtils.splitToken (TokenUtils.java:21) at com.auth0.jwt.JWTDecoder. (JWTDecoder.java:27) at com.auth0.jwt.JWT.decode (JWT.java:21) at eu.europa.ec.leos.api.auth.LeosApiAuthenticationFilter.attemptAuthentication (LeosApiAuthenticationFilter.java:62) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter (AbstractAuthenticationProcessingFilter.java:231) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter (AbstractAuthenticationProcessingFilter.java:221) at org.springframework.security.web.FilterChainProxyVirtualFilterChain.doFilter (FilterChainProxy.java:361) at org.springframework.web.filter.CorsFilter.doFilterInternal (CorsFilter.java:91) at org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:117) at org.springframework.security.web.FilterChainProxy
VirtualFilterChain.doFilter (FilterChainProxy.java:361) at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter (HeaderWriterFilter.java:90) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal (HeaderWriterFilter.java:75) at org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:117) at org.springframework.security.web.FilterChainProxy
VirtualFilterChain.doFilter (FilterChainProxy.java:361) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal (WebAsyncManagerIntegrationFilter.java:62) at org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:117) at org.springframework.security.web.FilterChainProxy
VirtualFilterChain.doFilter (FilterChainProxy.java:361) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter (SecurityContextPersistenceFilter.java:117) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter (SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy
VirtualFilterChain.doFilter (FilterChainProxy.java:361) at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal (DisableEncodeUrlFilter.java:42) at org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:117) at org.springframework.security.web.FilterChainProxy
VirtualFilterChain.doFilter (FilterChainProxy.java:361) at org.springframework.security.web.FilterChainProxy.doFilterInternal (FilterChainProxy.java:225) at org.springframework.security.web.FilterChainProxy.doFilter (FilterChainProxy.java:190) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate (DelegatingFilterProxy.java:354) at org.springframework.web.filter.DelegatingFilterProxy.doFilter (DelegatingFilterProxy.java:267) at org.eclipse.jetty.servlet.FilterHolder.doFilter (FilterHolder.java:201) at org.eclipse.jetty.servlet.ServletHandler
Chain.doFilter (ServletHandler.java:1626) at org.eclipse.jetty.servlet.ServletHandler.doHandle (ServletHandler.java:552) at org.eclipse.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle (SecurityHandler.java:571) at org.eclipse.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java:127) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:235) at org.eclipse.jetty.server.session.SessionHandler.doHandle (SessionHandler.java:1624) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:233) at org.eclipse.jetty.server.handler.ContextHandler.doHandle (ContextHandler.java:1440) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope (ScopedHandler.java:188) at org.eclipse.jetty.servlet.ServletHandler.doScope (ServletHandler.java:505) at org.eclipse.jetty.server.session.SessionHandler.doScope (SessionHandler.java:1594) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope (ScopedHandler.java:186) at org.eclipse.jetty.server.handler.ContextHandler.doScope (ContextHandler.java:1355) at org.eclipse.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:191) at org.eclipse.jetty.server.handler.HandlerCollection.handle (HandlerCollection.java:146) at org.eclipse.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java:127) at org.eclipse.jetty.server.Server.handle (Server.java:516) at org.eclipse.jetty.server.HttpChannel.lambda
handle
1 (HttpChannel.java:487) at org.eclipse.jetty.server.HttpChannel.dispatch (HttpChannel.java:732) at org.eclipse.jetty.server.HttpChannel.handle (HttpChannel.java:479) at org.eclipse.jetty.server.HttpConnection.onFillable (HttpConnection.java:277) at org.eclipse.jetty.io.AbstractConnection
ReadCallback.succeeded (AbstractConnection.java:311) at org.eclipse.jetty.io.FillInterest.fillable (FillInterest.java:105) at org.eclipse.jetty.io.ChannelEndPoint
1.run (ChannelEndPoint.java:104) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask (EatWhatYouKill.java:338) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce (EatWhatYouKill.java:315) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce (EatWhatYouKill.java:173) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run (EatWhatYouKill.java:131) at org.eclipse.jetty.util.thread.ReservedThreadExecutor
ReservedThread.run (ReservedThreadExecutor.java:409) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:883) at org.eclipse.jetty.util.thread.QueuedThreadPool
$Runner.run (QueuedThreadPool.java:1034) at java.lang.Thread.run (Thread.java:748)
RELEASE AND BUILD VERSION
The current version of the repository
STEPS TO REPRODUCE
Install LEOS on a server and try to access it from an external device.