Skip to content

JWT token is not refreshing  #21376

Closed
eclipse-che/che-dashboard
#524

Description

@Ryder05

Describe the bug

I successfully deployed eclipse che on k8s with an external keycloak. After 5 mins the JWT token expire and "500 – Internal Server Error" shows up.

image

After investigation i found out that the token is not being sent with the request "/api/websocket?token=" and eclipse che is not retrieving the keycloak settings from the endpint keycloak/settings.

image

Che version

7.47@latest

Steps to reproduce

  1. chectl server:deploy --domain=eclipse-che.<REDACTED> --platform=k8s --che-operator-cr-yaml=CheClusterCR.yml --skip-oidc-provider-check

CheClusterCR.yml file:

apiVersion: org.eclipse.che/v1
kind: CheCluster
metadata:
  name: eclipse-che
spec:
  auth:
    externalIdentityProvider: true
    identityProviderURL:  https://<REDACTED>/auth/realms/<realm>
    openShiftoAuth: false
    oAuthClientName: 'ovh-kube'
    oAuthSecret: '<REDACTED>'
  server: 
    externalDevfileRegistry: false
    cheHostTLSSecret: "che-https-certificates"
    workspaceNamespaceDefault:  <username>
  database:
    externalDb: false
  k8s:
    tlsSecretName: 'che-tls'
    ingressDomain: 'eclipse-che.<REDACTED>' 

Expected behavior

Access token expire after 5 mins and get refreshed using refresh tokens.

Runtime

Kubernetes (vanilla)

Screenshots

image

Installation method

chectl/latest

Environment

Windows

Eclipse Che Logs

2022-05-06 12:19:12,020[nio-8080-exec-2]  [ERROR] [o.a.c.c.C.[.[.[/api].[default] 175]  - Servlet.service() for servlet [default] in context with path [/api] threw exception
io.jsonwebtoken.ExpiredJwtException: JWT expired at 2022-05-06T10:31:14Z. Current time: 2022-05-06T12:19:12Z, a difference of 6475020 milliseconds.  Allowed clock skew: 3000 milliseconds.
    at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:448)
    at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:550)
    at io.jsonwebtoken.impl.DefaultJwtParser.parseClaimsJws(DefaultJwtParser.java:610)
    at io.jsonwebtoken.impl.ImmutableJwtParser.parseClaimsJws(ImmutableJwtParser.java:173)
    at org.eclipse.che.multiuser.oidc.filter.OidcTokenInitializationFilter.processToken(OidcTokenInitializationFilter.java:74)
    at org.eclipse.che.multiuser.api.authentication.commons.filter.MultiUserEnvironmentInitializationFilter.doFilter(MultiUserEnvironmentInitializationFilter.java:127)
    at org.eclipse.che.commons.logback.filter.RequestIdLoggerFilter.doFilter(RequestIdLoggerFilter.java:50)
    at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121)
    at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:769)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:353)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:872)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1705)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:829)

Additional context

No response

Activity

  1. added
    kind/bug
    on May 6, 2022
  2. added
    status/need-triage
    on May 6, 2022
  3. tolusha commented on May 9, 2022

    @tolusha
    Contributor
  4. added
    severity/P1
    and removed
    status/need-triage
    on May 9, 2022
  5. olexii4 commented on May 16, 2022

    @olexii4
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/che-serverarea/dashboardkind/bugseverity/P1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions