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

Fix caching of ClientCredentialsOauth2 object when deployed on multiple tenants. #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Cynicjon
Copy link

If this app is published in two tenants, the caching of _auth_method() will mean the same ClientCredentialsOauth2 object is used for both tenants. This causes an intermittent authentication error issue. If tenant A requests a token, it is set for tenant B, and vice versa, until it is refreshed.
This PR fixes that by passing the webhook.baseurl into _auth_method() thereby having a ClientCredentialsOauth2 object, per tenant, that is still cached as needed. There is no need to actually use webhook.baseurl, it is purely used for cache uniqueness.

If this app is published in two tenants, the caching of _auth_method() will mean the same ClientCredentialsOauth2 object is used for both tenants. This causes an intermittent authentication error issue. If tenant A requests a token, it is set for tenant B, and vice versa, until it is refreshed.
This commit fixes that by passing the baseurl into _auth_method thereby having a ClientCredentialsOauth2 object, per tenant, that is still cached as needed.
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

Successfully merging this pull request may close these issues.

1 participant