Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Token refresh - How to stay logged in #386

Open
ManiMatter opened this issue Jul 24, 2024 · 0 comments
Open

[Question] Token refresh - How to stay logged in #386

ManiMatter opened this issue Jul 24, 2024 · 0 comments

Comments

@ManiMatter
Copy link

Hi,

I am quite new to oauth and traefik, so I am not sure this is the right place to ask.
If not, appreciate any pointers where to go to look for answers and I'll be on my way :)

What I currently observe is that after 24h, I am always signed out and need to log back in.
It's a hard sign-out, even if I use the session in between, after 24h I need to re-login.

I understand why it is 24h, namely because I have set the lifetime parameter to 86400.

My understanding so far is that the session is not extended beyond 24h even if being used in the meantime because for that specific token refresh handling is required.

I am not sure if I fully understood it correctly, but if I did, then my next question would be: how would I do that with traefik-forward-auth? I found this PR, which seems related, any that would make me think it is currently not possible. Is that correct?

I consulted the Readme, but unfortunately to no avail. Any pointers greatly appreciated. Many thanks.

For completeness, this is my current config:

# Google OAuth - Single Sign On using OAuth 2.0
 oauth:
   <<: *common-keys-core
   container_name: oauth
   image: thomseddon/traefik-forward-auth:latest
   #image: thomseddon/traefik-forward-auth:2.1-arm # ARM
   environment:
     - CONFIG=/config
     - COOKIE_DOMAIN=$DOMAINNAME_CLOUD_SERVER
     - INSECURE_COOKIE=false
     - AUTH_HOST=oauth.$DOMAINNAME_CLOUD_SERVER
     - URL_PATH=/_oauth
     - LOG_LEVEL=info
     - LOG_FORMAT=text
     - LIFETIME=86400
     - DEFAULT_ACTION=auth
     - DEFAULT_PROVIDER=google
   secrets:
     - source: traefik_forward_auth
       target: /config
   labels:
     - "traefik.enable=true"
     - "traefik.http.routers.oauth-rtr.tls=true"
     - "traefik.http.routers.oauth-rtr.entrypoints=https"
     - "traefik.http.routers.oauth-rtr.rule=Host(`oauth.$DOMAINNAME_CLOUD_SERVER`)"
     - "traefik.http.routers.oauth-rtr.middlewares=chain-oauth@file"
     - "traefik.http.routers.oauth-rtr.service=oauth-svc"
     - "traefik.http.services.oauth-svc.loadbalancer.server.port=4181"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant