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

Provider token validity not updated in proxy outpost (filesystem) session store #12751

Open
sch0sven opened this issue Jan 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@sch0sven
Copy link

Describe the bug

We are using a forward auth scenario with traefik.

When updating the token validity of a provider, the updated value is not reflected in the session store of a proxy outpost. This leads to unnecessary redirects.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a provider settings dialog and set the token duration to something other then the default of 1 minute, maybe 2 minutes
  2. Access an app
  3. Wait 2 minutes
  4. Hit refresh
  5. See authentication redirects

Expected behavior
Direct app access without any redirects for the duration of the set token validity.

Screenshots

As this is dynamic behavior it is hard to capture in screenshots.

Logs
Output of docker-compose logs or kubectl logs respectively

Version and Deployment (please complete the following information):

  • authentik version: 2024.10.5 - but I checked the sources of newer versions and I do not think this is fixed.
  • Deployment: ecs

Additional context

The problem can be resolved with a restart of the outpost.

I did some digging in the code, and I think this due to the gorilla FileSystemStore.
I think it is not updated, when the provider configuration changes.

I've seen the Refresh() method, it iterates over the providers, gets their config and calls new Application(provider, ...) for each:

		existing, ok := ps.apps[externalHost.Host]
		a, err := application.NewApplication(provider, hc, ps, existing)

But therein, the session store is being taken over from a previous configuration, and not reinitialized via getStore():

	if oldApp != nil && oldApp.sessions != nil {
		a.sessions = oldApp.sessions
	} else {
		sess, err := a.getStore(p, externalHost)
		if err != nil {
			return nil, err
		}
		a.sessions = sess
	}

And thus the store is not updated.

@sch0sven sch0sven added the bug Something isn't working label Jan 21, 2025
@sch0sven sch0sven changed the title Provider token validity not update in proxy outpost (filesystem) session store Provider token validity not updated in proxy outpost (filesystem) session store Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant