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

Strava heatmap authentication #2

Open
bertt opened this issue Mar 16, 2018 · 30 comments
Open

Strava heatmap authentication #2

bertt opened this issue Mar 16, 2018 · 30 comments

Comments

@bertt
Copy link
Owner

@bertt bertt commented Mar 16, 2018

Strava heatmaps after level 12 give now an error, for example:

$ curl https://heatmap-external-c.strava.com/tiles/all/hot/14/8423/5363.png
403: authentication is now required for data access beyond zoom level 12, please login to strava.com and then visit /auth

How to add this authentication stuff? Did a quick test retrieving tile with added tokens but no luck yet.

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 16, 2018

When used under WMTS on QGIS with
https://bertt.github.io/wmts/capabilities/strava.xml
I can see it between 0 and 13 zoom... From 14 onwards just disappear.... it does not state any errors ... just dont show it...

Used to work a couple of days ago thou....

@bertt

This comment has been minimized.

Copy link
Owner Author

@bertt bertt commented Mar 16, 2018

yes here the blog describing the changes: https://blog.strava.com/press/heatmap-updates/

@bertt

This comment has been minimized.

Copy link
Owner Author

@bertt bertt commented Mar 16, 2018

on site https://www.strava.com/heatmap#18.00/-119.26759/36.19952/blue/all I see a lot of 403 errors (Access denied) on detailed tile levels and after login.

Tiles are retrieved from tiles-auth route: https://heatmap-external-b.strava.com/tiles-auth/all/blue/16/11054/25688.png?v=19

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 17, 2018

@mbernasocchi any idea ? issue above ?
This seems still to be working ....
http://globalheat.strava.com/tiles/both/color1/{z}/{x}/{y}.png

Title: Strava Both
Credit: © Strava for tracing into OSM only
URL: http://globalheat.strava.com/tiles/both/color1/{z}/{x}/{y}.png
yOrigin: Top (yOriginTop=1)
Zoom range: 0 - 18
Layer Extent: Not set

It is coming form NextGIS... @simgislab any idea the issue above ?
https://github.com/nextgis/quickmapservices_contrib

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 17, 2018

@simgislab

This comment has been minimized.

Copy link

@simgislab simgislab commented Mar 17, 2018

@alpter don't use contrib, rarely updated, use http://qms.nextgis.com, search for Strava, may be other sources would help better

@bertt

This comment has been minimized.

Copy link
Owner Author

@bertt bertt commented Mar 17, 2018

the old heatmap (http://globalheat.strava.com/tiles/both/color1/0/0/0.png) still works but has less features and is not updated anymore i guess.

@andrea-del-sarto

This comment has been minimized.

@bertt

This comment has been minimized.

Copy link
Owner Author

@bertt bertt commented Mar 19, 2018

@andrea-del-sarto it gives an error, for example:

$ curl https://heatmap-external-b.strava.com/tiles-auth/all/bluered/14/8423/5363.png?px=256
<?xml version="1.0" encoding="UTF-8"?><Error><Code>MissingKey</Code><Message>Missing Key-Pair-Id query parameter or cookie value</Message></Error>

Question is: How to add a 'Key-Pair-Id query parameter'?

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 19, 2018

@andrea-del-sarto does not work....
I found this osmlab/editor-layer-index#373
on the last exchange they talk about "maximum zoom level" permitted and "authentication"...
...
for example
https://heatmap-external-c.strava.com/tiles/both/bluered/12/1505/2306.png

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 19, 2018

@tyrasd it seems we can not get the old version of the strava heatmap anymore below zoom 12/13.
Is there any solution ? In JOSM same problem...
https://bertt.github.io/wmts/capabilities/strava.xml

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 19, 2018

I guess we are stacked at present... until STRAVA / MAPBOX wont solve it...
https://josm.openstreetmap.de/ticket/16100

@andrea-del-sarto

This comment has been minimized.

Copy link

@andrea-del-sarto andrea-del-sarto commented Mar 19, 2018

sorry, i've use it on osm id/strava id how custom background with strava login :(
anyway zoom level 12 work if use 256px version of the tiles
don't work > https://heatmap-external-c.strava.com/tiles/both/bluered/12/1505/2306.png
work > https://heatmap-external-c.strava.com/tiles/both/bluered/12/1505/2306.png?px=256

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 19, 2018

@mourner... see my comment here
Any way we can get around ?

exactly!Since the new Heat Map is being developed under​Mapbox GL they just need to set proper individual ​access tokens in order to associate requests to API resources with each personal STRAVA account. I guess... but... How long would it take ?
https://josm.openstreetmap.de/ticket/16100

@mourner

This comment has been minimized.

Copy link

@mourner mourner commented Mar 19, 2018

@alpter as far as I know, Strava has their own heatmap implementation that is completely independent of ours. No idea how to help you here.

@tyrasd

This comment has been minimized.

Copy link

@tyrasd tyrasd commented Mar 19, 2018

me neither, but maybe (hopefully) someone from @strava can tell us more about this issue, e.g. @drewrobb.

@scrapperuk

This comment has been minimized.

Copy link

@scrapperuk scrapperuk commented Mar 21, 2018

keen to find a fix for this as an end user... I have a Strava login but cant apply the authentication to the iD editor..
I've even tried contacting the guy who developed this while at Strava, as its too cool to lose

will let you know if i hear anything (although I'm not a coder, so might have to use some plain English)

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 22, 2018

@inexcitus could you have a look at this issue... any idea ?

@alpterlab

This comment has been minimized.

Copy link

@alpterlab alpterlab commented Mar 23, 2018

Thanks @scrapperuk @paulmach lets keep it up..
paulmach/slide#12

@StevenClays

This comment has been minimized.

Copy link

@StevenClays StevenClays commented May 17, 2018

@bertt In JOSM its works, adding the cookies values by doing something like this >
tms[3,15]:https://heatmap-external-{switch:a,b,c}.strava.com/tiles-auth/both/bluered/{zoom}/{x}/{y}.png?Key-Pair-Id={my-value}&Signature={my-value}&Policy={my-value}
But how can I achieve the same result in QGIS? Thanks for helping me out

@bertt

This comment has been minimized.

Copy link
Owner Author

@bertt bertt commented May 17, 2018

@StevenClays ah interesting, so only with cookie parameters in the request querystring (and not in the request headers)?

@StevenClays

This comment has been minimized.

Copy link

@StevenClays StevenClays commented May 17, 2018

In JOSM this works, but I cannot get QGIS to do this. What could I be doing wrong? I'm not so acquainted with terms as 'request headers', in JOSM I just entered this link and it worked... @bartt

@bertt

This comment has been minimized.

Copy link
Owner Author

@bertt bertt commented May 17, 2018

@StevenClays where did you get that url from?

@StevenClays

This comment has been minimized.

Copy link

@StevenClays StevenClays commented May 17, 2018

@bertt In the JOSM-thread regarding this issue > https://josm.openstreetmap.de/ticket/16100

@bertt

This comment has been minimized.

Copy link
Owner Author

@bertt bertt commented May 17, 2018

ok thanks :-) At the moment I don't know why QGIS doesn't work with this url but JOSM apparently does work.

@StevenClays

This comment has been minimized.

Copy link

@StevenClays StevenClays commented May 17, 2018

@bertt Thanks for looking into it. Hopefully you can work it out...

@luiswoo

This comment has been minimized.

Copy link

@luiswoo luiswoo commented Jun 15, 2018

Hi, is it possible to add gps tracks by Yandex (n.maps.yandex.ru)?
https://core-gpstiles.maps.yandex.net/tiles?style=point&x=37275&y=19294&z=16
https://core-gpstiles.maps.yandex.net/tiles?style=red_combined&x=37268&y=19297&z=16

"ygpx": { \
     "name": "yandex gps point",
     "prefix": "ygpx",			# tile directory
     "ext": "png",			# tile images extension
     "scalable": False,			# could zN tile be constructed of four z(N+1) tiles
     "fetch": fetchers.Tile,		# function that fetches given tile. should return None if tile wasn't fetched
     "remote_url": "https://gps-tiles.maps.yandex.net/tiles?style=point&x=%s&y=%s&z=%s",
     "transform_tile_number": lambda z,x,y: (x,y,z-1),
     "dead_tile": install_path + "yandex_nxt.jpg",
     "proj": "EPSG:3395",
},\
"ygpx_red_combined": { \
     "name": "yandex gps red_combined",
     "prefix": "ygpx_red_combined",		# tile directory
     "ext": "png",				# tile images extension
     "scalable": False,				# could zN tile be constructed of four z(N+1) tiles
     "fetch": fetchers.Tile,			# function that fetches given tile. should return None if tile wasn't fetched
     "remote_url": "https://gps-tiles.maps.yandex.net/tiles?style=red_combined&x=%s&y=%s&z=%s",
     "transform_tile_number": lambda z,x,y: (x,y,z-1),
     "dead_tile": install_path + "yandex_nxt.jpg",
     "proj": "EPSG:3395",
},\

^
this is for TWMS https://github.com/Komzpa/twms

https://n.maps.yandex.ru/#!/help?z=16&ll=24.740202%2C59.432151&l=nk%23sat

@bertt bertt mentioned this issue Jun 29, 2018
@nnngrach

This comment has been minimized.

Copy link

@nnngrach nnngrach commented Apr 19, 2019

I have written a script to automatically log in to Strava and receiving of cookies. To do this, I used a Headless Chrome browser controlled by the Puppeteer script. Details and the script on this link:

https://github.com/nnngrach/strava_auto_auth

@Jochem-L

This comment has been minimized.

Copy link

@Jochem-L Jochem-L commented Sep 14, 2019

@bertt In JOSM its works, adding the cookies values by doing something like this >
tms[3,15]:https://heatmap-external-{switch:a,b,c}.strava.com/tiles-auth/both/bluered/{zoom}/{x}/{y}.png?Key-Pair-Id={my-value}&Signature={my-value}&Policy={my-value}
But how can I achieve the same result in QGIS? Thanks for helping me out

I got it working in QGIS:

In Chrome, go to: https://www.strava.com/heatmap
Log in;
In Chrome, go to: chrome://settings/cookies/detail?site=strava.com
Click: CloudFrontKey-Pair-Id, CloudFrontPolicy and CloudFrontSignature
Copy-paste Content values to text editor;
In text editor, copy-paste URL:
https://heatmap-external-a.strava.com/tiles-auth/both/gray/{z}/{x}/{y}.png?v=19&Key-Pair-Id=APKAIDEUN4QMG7VUQPS
&Policy=eyJTdGE0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHBzOi8vaGVhdG1hcC1leHRlcm5hbC0qLnN0cmF2YS5jb20vKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTU2OTMwOTc0NH0sIkRhdGVHcmVhdGVyVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNTY4MDg1NzQ0fX19XX0_
&Signature=dRuUDLEomc0j92k-CBPkktGLENwVrQKkuhQEeYGlGBmtRHIsm3lX-7kwqIH3QEsgquEB-wgL2O9g63rfl1JRxLgaAlF21UZeDp4YWSZGg5BMr6aDcH6zWjegGFEkQEqX8bGVgoBSobgDvmTICPtAMebpt3NxJHIFtL0R1yy6coS5d9JjsryTLknWFKZRg6i2QPOdTVURE1sRe82c2p36MFYFVKzlMC9srpnVZVQ2yN1JYxqn9Xld4PwUTFQcZFQngmv-vT31mUlLDiCkEcCrZaxNTpzCZc5zSMDtB-RvOhPD3vW9Q3dcVeP-9j93atB-BwyizEhlOuwOWeBsBQ__
Replace Key-Pair-Id, Policy and Signature values;
Remove the line breaks in the URL;
In QGIS, in browser panel: Right click, Choose New connection;
In dialog window: Type a free to choose name, Paste URL, Click OK;
In browser panel: Dubble click the name;
Repeat procedure when cookie is expired (1 week?).

@nnngrach

This comment has been minimized.

Copy link

@nnngrach nnngrach commented Sep 15, 2019

Hi. I updated the API for my service to automatically access Strava tiles without authorization and replacing cookies. You can just use a URL like this:

https://anygis.ru/api/v1/Tracks_Strava_All/{x}/{y}/{z}

The full list of available URL maps can be found here:

https://github.com/nnngrach/strava_auto_auth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.