Not fetching user in log
I have implemented the example of the mobile app with the user plugin as the documentation says.
I authenticate correctly, I do a subsequent connection using the auth token to get the user info and it works. But when I look at the logs, it says "No user for this API Key".
I'm connecting to the api from another site via PHP/cURL.
I'm interesed in doing this because I want to give specific users specific rate limits. Does anyone know where I may be failing?
Thanks!!
I'm answering myself on this one, but I leave it open for opinions and suggestions.
The thing is that although header authentication is accepted, the logging for rate checkings are done against the parameter "key". I have solved it by modifying the http controller, at the display moment I copy the Authentication header into the "key" parameter of the input object, so they both work the same way.
On the other hand, the rate limit is checked against the global limit, not the user specific, so I changed the $limit variable in plugin.php library, so it reflects the value of the per_hour field of the api_key table in the database.
The rest works great.
I hope this helps someone else.
hello Cybersantu,
This is a great idea, and it solves a problem I will have very soon in one of my projects.
thank you very much!
On Fri 8. Jan 2021 at 05:10, cybersantu [email protected] wrote:
I'm answering myself on this one, but I leave it open for opinions and suggestions.
The thing is that although header authentication is accepted, the logging for rate checkings are done against the parameter "key". I have solved it by modifying the http controller, at the display moment I copy the Authentication header into the "key" parameter of the input object, so they both work the same way.
On the other hand, the rate limit is checked against the global limit, not the user specific, so I changed the $limit variable in plugin.php library, so it reflects the value of the per_hour field of the api_key table in the database.
The rest works great.
I hope this helps someone else.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/techjoomla/com_api/issues/125#issuecomment-756549735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVOX7KO5PC7XO622S3K5BDSY2HU5ANCNFSM4VZWQYLQ .
--
Alejandro Sierra Serna