okta-auth-js
okta-auth-js copied to clipboard
Adding ability to get rate limit values .
Need a solution to retrieve okta rate limit values from response headers
HTTP/1.1 200 Date: Tue, 27 Jan 2018 21:33:25 GMT X-Rate-Limit-Limit: 600 X-Rate-Limit-Remaining: 598 X-Rate-Limit-Reset: 1516308901.
@SripriyaM - Thanks for the info!
@SripriyaM - Sorry, overeager keyboard.
Currently we don't have a low-effort way to expose that info, but we're looking into it. Meanwhile, a work-around is to pass in your own requestor object: https://github.com/okta/okta-auth-js#httprequestclient
You can make this requestor do the work of our request (copy the contents of https://github.com/okta/okta-auth-js/blob/master/fetch/fetchRequest.js along with any reading of the headers you want)
Hope that helps!
@SripriyaM - As we investigate a better solution - can you clarify which calls you are trying to get the rate limits to? (Obviously how we handle a redirect will be different than whatever call you got the 200 from in your initial report)
Thanks in advance!
@swiftone - Trying to get the rate limits for calls to /authn,/token,/session,/users(create,list,update,delete,get),/sessions,/oauth2/{authorizationServerId}/v1 API calls .The idea is to see the rate limits usage based on the tables given in https://developer.okta.com/docs/reference/rate-limits/#high-capacity-rate-limits .
@swiftone - I have tried the workaround mentioned in above post . It only prints basic header information like "cache-control -> no-cache, no-store content-type -> application/json;charset=UTF-8 expires -> 0 pragma -> no-cache"
and not a full response header(The CORS is enabled on server ) . Since its not getting complete information , i am unable to retrieve rate limit information from response header . Could you kindly advise , if there is another setting i need to do in code or in server configuration.
@SripriyaM - The functionality you are asking for doesn't appear to exist in this library at this time - I suggest emailing [email protected] to get in touch with the support staff to see about how best to expose this information and get any issue prioritized.
Sorry I can't be more immediately helpful.
Internal Ref: OKTA-412511