Hi, I am using a trial version of tyk cloud gateway. I have created an api using JWT authentication type. actially I want to rate limit dynamically on the basis of JWT policy claims. I have added two policy and mapped those policy in the API definition . but when I am trying to access the api tyk is not blocking the request as per the rate limit which i set in the policy. Any help would be really appreciated.
My steps are as follows:
-
created an API
-
chosen authentication as JWT
payload of my JWT as below
{
“sub”: “37577”,
“name”: “ratnesh”,
“iat”: 1516239022,
“policy”: “user1”
} -
added 2 policy JWT policy1 and JWT policy2
-
set rate limit 5 per 60 sec for JWT policy1 and 10 per 60 sec for JWT policy2
-
mapped the JWT scope claims in API definition as
Claim name Policy name
user1 JWT policy1
user2 JWT policy2 -
I am generating the JWT tokens for both type of policy claims
Now, when I try to hit the API by passing these JWT token Rate limit is not working as expected. for continuous hits I am getting the response no blocking at all.