Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

403 response codes using anonymous authentication #14

Open
bh3605 opened this issue Dec 2, 2023 · 0 comments
Open

403 response codes using anonymous authentication #14

bh3605 opened this issue Dec 2, 2023 · 0 comments

Comments

@bh3605
Copy link

bh3605 commented Dec 2, 2023

I'm using anon auth. I have everything setup correctly. Azure function and what not. In my case, I interface it through api manager. I'm getting the token back just fine. Here's what my token looks like.

{
"typ": "JWT",
"alg": "RS256",
"x5t": "T1St-dLTvyWRgxB_676u8krXS-I",
"kid": "T1St-dLTvyWRgxB_676u8krXS-I"
}.{
"aud": "https://atlas.microsoft.com",
"iss": "https://sts.windows.net/organization-tenant-id/",
"iat": redacted,
"nbf": redacted,
"exp": redacted,
"aio": "E2VgYEhr+f96e6v0ew+LzbvMWS89BQA=",
"appid": "a8a9f121-896a-4a4d-a181-1922e02a2683",
"appidacr": "2",
"idp": "https://sts.windows.net/organization-tenant-id/",
"oid": "5a0e95b4-60d3-49d0-aa1f-a4ded8c3b41f",
"rh": "0.AAcAPtc9i3JOeUaxkVbaFYhxKyKgHroHWNVBu-spLH4c9fYHAAA.",
"sub": "5a0e95b4-60d3-49d0-aa1f-a4ded8c3b41f",
"tid": "organization-tenant-id",
"uti": "mh7SaofszEeVW5EP8DRdAA",
"ver": "1.0"
}.[Signature]

Here's my javascript code (this.mapKey is assigned the token value after it's retrieved from apim so by the time the code below executes this member variable is already populated)

new atlas.Map(this.mapElement.nativeElement, {
      // view: 'Unifed',
      center: [-79.995888, 40.440624],
      zoom: 11,
      language: 'en-US',
      disableTelemetry: true,
      authOptions: {
        authType: atlas.AuthenticationType.anonymous,
        clientId: "azure-map-client-id",
        getToken: (resolve: any, reject: any, map: any) => {
          resolve(this.mapKey);
        }
      }
    });

The map initially loads just fine. It's moving around when 403s start throwing. It's completely random. Sometimes the attribution endpoint throws and sometimes it's the tile endpoint. Sometimes it's both. Doesn't make any sense why. Can you help?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant