mapbox / mapbox/mapbox-gl-js

Receiving error 401: Unauthorized

Open
#13,325 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation :mag:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Getting 401 error for next requests:
1) https://events.mapbox.com/events/v2?access_token={accessToken}
Events are - "map.load", "gljs.performance", "style.load".
2) https://api.mapbox.com/map-sessions/v1?sku={SKU}&access_token={accessToken}

Allowed domains are set correctly via Admin Panel.

The access token is correct - map data is loaded as expected. However, these requests are sent by the lib itself and I cannot figure out why I am getting these errors.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the 401 responses for the events.mapbox.com/events/v2 and api.mapbox.com/map-sessions/v1 requests while confirming the access token and allowed domains. Trace where the library constructs these requests and compare their authorization requirements with the requests that successfully load map data; done means identifying the cause and verifying that both requests authenticate correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.