Hey, we are using a Free Ory Network project for I...
# ory-network
a
Hey, we are using a Free Ory Network project for IAM. We recently migrated one of our apps to use Kratos for authentication and it seemed everything is working fine. But now we are randomly getting 429s and we can't understand what's happening. We authenticate the user on the browser side and then verify the caller on server-side requests based on their cookies. So first you log in on our website, you get your Kratos cookie and when making requests to the backend that cookie is attached. The backend then verifies user identity by calling Kratos. As the app initializes, we're marking around 10 requests to the backend in a matter of a second. We noticed now that sporadically, one or more of those would fail. Ory Network starts returning 429 on any request for that session token for around 5-30 seconds. I did not find any mention about this behavior in the docs. Could you please help me understand what's happening and how to work around this issue?
Slight edit: we are using Ory Proxy to handle calls to Ory. I just realized that when loading our app in dev mode, it will make a lot of requests for locally served js files. Those go through the proxy, get authenticated, and likely rightfully result in a 429
I now understand what the "Zero Trust" part of the proxy does. I didn't give it much thought before.
s
Hi Mateusz, The proxy is doing internal session checks (sessions/whoami) for each request. As this includes other resources like js files etc, the number of requests to the sessions/whoami endpoint can be quite high and result in being rate limited.
a
I see, it looks like that's whats happening. Thanks!
s
For now, you can reduce the number of requests by caching these resources on the client side. We will discuss internally if/how we optimize the proxy.
a
It could be possibly useful to be able to specify what paths are exempt from the session check 🤔
Anyway, thanks for taking a look, I appreciate it!
s
It could be possibly useful to be able to specify what paths are exempt from the session check 🤔
yes, exactly. This was also my thought, but we will check this tomorrow. Maybe I am missing something… Have a nice evening.
@acoustic-insurance-23566 I created a Github issue for this: https://github.com/ory/cli/issues/299
a
Thanks!