Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not fetching user in log #125

Open
cybersantu opened this issue Jan 7, 2021 · 2 comments
Open

Not fetching user in log #125

cybersantu opened this issue Jan 7, 2021 · 2 comments

Comments

@cybersantu
Copy link

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!!

@cybersantu
Copy link
Author

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.

@asierraserna
Copy link

asierraserna commented Jan 9, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants