-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
In the Ruby SDK, WorkOS::UserManagement.load_sealed_session seems to fetch the remote JWKS on every load, adding about 100ms to each authenticated request.
We use Rails and for every authenticated request, we call authorize_request which does the following:
session = WorkOS::UserManagement.load_sealed_session
result = session.authenticate
@user = result[:user]
After implementing WorkOS, we realized all of our authenticated endpoints now take 100ms longer on the backend. It took some digging through our Sentry profiles to find that create_remote_jwk_set was called repeatedly:
workos-ruby/lib/workos/session.rb
Line 26 in 8c401c2
| @jwks = create_remote_jwk_set(URI(@user_management.get_jwks_url(client_id))) |
We host our services on Render.com on GCP's oregon-1 region.
Please advise if there is a better way to authenticate the token or if improvements can be made to the SDK. Thanks!

adam-h
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request