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

MapBox Tiles Sometimes Not Working #13

Open
dalezak opened this issue May 30, 2017 · 3 comments
Open

MapBox Tiles Sometimes Not Working #13

dalezak opened this issue May 30, 2017 · 3 comments

Comments

@dalezak dalezak self-assigned this May 30, 2017
@dalezak
Copy link
Contributor Author

dalezak commented Jun 1, 2017

Ah-ha!

The app currently is using the mapbox_api_key defined in the deployments config.json.

However the issue is that mapbox_api_key might not have the necessary scopes, in particault styles:tiles needed to render static map images.

@dalezak
Copy link
Contributor Author

dalezak commented Jun 1, 2017

Ok, I've figured a few things out (one step forward, two steps back!).

To be able to obtain the scopes for an access token, I need to know the username.

Luckily you can do a lookup of username from access token like https://api.mapbox.com/tokens/v2?access_token=pk.eyJ1IjoidXNoYWhpZGkiLCJhIjoiY2lxaXRrbmF5MDdxNmZubmUyN2p6bms5biJ9.o7pmKDIN1EtwMBp1VIzITQ

With the username, you can now find the scope https://api.mapbox.com/scopes/v1/ushahidi/?access_token=pk.eyJ1IjoidXNoYWhpZGkiLCJhIjoiY2lxaXRrbmF5MDdxNmZubmUyN2p6bms5biJ9.o7pmKDIN1EtwMBp1VIzITQ

However that request requires scopes:list, otherwise it simply returns "message": "Not Found" error.

So this doesn't get us very far, and probably means I can not reliably determine the scopes from an access token provided in the config.json.

@dalezak
Copy link
Contributor Author

dalezak commented Jun 1, 2017

Still need to figure out how best to handle this scenario, moving this back to next Milestone.

@dalezak dalezak removed their assignment Jun 6, 2018
@tuxpiper tuxpiper transferred this issue from another repository Apr 7, 2021
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

1 participant