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

OAuth2 require DB strong consistancy #11461

Open
lsjostro opened this issue Sep 20, 2024 · 0 comments
Open

OAuth2 require DB strong consistancy #11461

lsjostro opened this issue Sep 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lsjostro
Copy link

lsjostro commented Sep 20, 2024

Describe the bug
When using PG read replicas with async replication you will run into a race condition.
Exactly here will require strong consistency https://github.com/goauthentik/authentik/blob/main/authentik/providers/oauth2/views/token.py#L219. Might be more places also?

Either document that Authentik to require strong consistency or force certain DB calls to primary db instance?

To Reproduce
Steps to reproduce the behavior:

  1. Create a oidc provider as Public (PKCE).
  2. Have a PG cluster with async replication and configure Authentik with read replicas.
  3. Try auth.

Expected behavior
successful auth

Logs
Server: {.. "event": "Code does not exist", ..}
Client: invalid_grant

Version and Deployment (please complete the following information):

  • authentik version: 2024.8.1
@lsjostro lsjostro added the bug Something isn't working label Sep 20, 2024
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