Hi, I have setup OSM server using mod-tiles and renderd. I want to implement key based access control to map tiles, something similar to Google map key. How can I do this? asked 21 Jan '17, 09:02 Reshma Maner |
There are many possible ways to do that. You could certainly add key handling directly to mod_tile if some C programming isn't too big a hurdle. Another option (but one that requires a config file reload on Apache every time the list changes) is to do this via Apache, either by creating one "AddTileConfig" directive per API key or by using somethig like mod_perl to generate these AddTileConfig rules programmatically, reading the keys from a file. answered 21 Jan '17, 22:18 Frederik Ramm ♦ Could you provide an example of 'creating one "AddTileConfig" directive per API key'?
(31 Mar '17, 17:06)
rgwozdz
1
Sure: Instead of
which will lead Apache to map http://somehost/tile/z/x/y.png to tiles of your "mycoolmapstyle" type, you would
and so on. These API keys, if long enough, cannot be guessed so they are "secret". Instead of the above, it is also possible to use mod_perl to read the API keys from a file and then generate the AddTileConfig directives.
(31 Mar '17, 17:38)
Frederik Ramm ♦
Hi, If I add an apikey in tileserver_site.conf as given above, then what changes do I need to make in my OpenLayer code to access the map?
(24 Jul '17, 10:25)
Reshma Maner
1
When creating the tile layer in OpenLayers you can specify the URL to use. In your case the URL would have to look like http://myserver/apikey1/${z}/${x}/${y}.png.
(24 Jul '17, 13:24)
Frederik Ramm ♦
|
Hi, I dont understand how it works. Please, explain me. What means "mycoolmapstyle" in the example? I f i create a "/apikey1" i dont need create a symbolic link to /var/lib/mod_tile? Do you have an example of mod_perl and where i save this files? Thank you. answered 10 May '18, 23:36 Flaviomx14 |
Hi
I need some more help in this, if somebody can guide me what exactly do I need to do if I want to implementing API Key based access control for mod-tiles.
my tileserver_site.conf file contains following lines which are commented.
AddTileConfig /folder/ TileSetName
How do I create APIs and use them for allowing map access?