You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
M2M.authenticate_token() blocks event loop on JWKS fetch #312
Not 101% sure that this observation is correct, but please review 🙏 .
M2M.authenticate_token() lacks an async version and blocks the event loop when PyJWKClient fetches JWKS keys. The Sessions API correctly handles this with asyncio.to_thread(), but M2M does not.
The docstring for M2M.authenticate_token() states:
"Note: There is no async version of this since we make no network calls."
This blocks the async event loop, causing latency spikes in async applications.
changed the title [-]M2M.authenticate_token() to blocks event loop on JWKS fetch[/-][+]M2M.authenticate_token() blocks event loop on JWKS fetch[/+]on Apr 23, 2026
Activity
[-]M2M.authenticate_token() to blocks event loop on JWKS fetch[/-][+]M2M.authenticate_token() blocks event loop on JWKS fetch[/+]logan-stytch commentedon Apr 23, 2026
Hey @vladislavkoz, you're totally right here. This was an oversight on our part. I've just put up #313 and once we land that, v15.1.0 should fix this.