-
Notifications
You must be signed in to change notification settings - Fork 4
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
Authentication using API keys #48
Comments
This one is on me. Will see what I can create. |
Would you merge #13 ! And I agree with you that it would be better if it's in the request body instead of the URL |
I'm curious to see what's your idea for this topic: I see different options that might be explored, depending on the project goals / use cases. One publisher, few listenersUse cases
This is a situation where you basically have one publisher and N listeners, with N usually < 10. SecurityIn this case, the endpoints must be secured as follows:
Single location broadcastFor certain situations, it might make sense to broadcast the location of an object / person. Use cases
Security
Many publishers, few listenersCertain use-cases might need different publishers to send their location to a centralized place. Use cases
Security
Many publishers, many listenersThis is the most complex use case: in certain situations you might want to broadcast the position of many objects / people in real time, and let this be visible by a lot of people. Use cases
This approach requires a better handling of the locations in the database, ideally with a Geo Spatial database such as PostGIS, so that only the locations in a certain bounding box / in a radius from the user's location are returned. Security
|
While testing the location tracker with a simple nginx reverse proxy set-up, I found out that the OsmAnd does not support Basic Authentication nor Digest Authentication. Bummer. However, TLS/SSL works. 👍
So, instead of using Basic Authentication, authentication with API keys would be a good alternative.
As TLS/SSL has been added (#44), the key can be added to the query parameters of a GET request (
GET /submit?api_key=...
). If used with TLS/SSL, it won't compromise the security. Only thing is that the server, when started in debug mode, might show the full URL with this "sensitive" data. Still, considering the server runs in a production environment, this is fine.An even better way of sending an API key via a GET request would be by using a cookie or request header, like
X-API-KEY: ...
, so there won't be a URL containing an API key written to the log files. However, setting cookies or request headers not possible with OsmAnd.The text was updated successfully, but these errors were encountered: