Skip to content

Commit

Permalink
docs: complete the FAQ with the URL restrictions for tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoulain committed Mar 18, 2021
1 parent 7f97051 commit 826354b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,7 @@ FAQ

If you want to use a provider with an API key, the best approach is generally to use Universal Geocoder in the server-side (Node) and to call it from the client-side.
This way the API key is not exposed directly.

Some providers allow to add URL restrictions when generating a token, like [Mapbox](https://docs.mapbox.com/help/getting-started/access-tokens/#url-restrictions).
Even if the token is visible, it mitigates its unwanted use since the `Origin` header [cannot be changed](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name) in a browser environment.
However, the stolen token would be still usable in a server environment (for instance with cURL).

0 comments on commit 826354b

Please sign in to comment.