data:read scope limit on authentication API version 2

  Kiến thức lập trình

After upgrading to version 2 of the authentication API, we seem to get an error when trying to retrieve the access token for multiple urns (>9 IFC models).

Here’s how we’re defining the scope parameter:

const modelScopes = models
      .map((model) => {
        const modelUrn = Buffer.from(model.forge_urn, "base64url").toString();
        return `data:read:${modelUrn}`;
      })
      .join(" ");

And here’s how we’re using it:

post(FORGE_AUTH_ENDPOINT, {
    headers: {
        'Authorization': authorizationHeader,
    },
    form: {
        grant_type: "client_credentials",
        scope: modelScopes,
    },
})

We had no issues here before, but the new API version seems to stop us from retrieving an access token when the “modelScopes” parameter is too long.

We frequently use more than 10 models, so we need a way to fix this.

New contributor

Nilsen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT