Jack
Jack

Reputation: 11

Autodesk Simple Viewer : AxiosError: Request failed with status code 403 & Could not obtain access token. See the console for more details

I'm working on implementing the Simple Viewer from Autodesk Platform Services for my dissertation and have encountered a couple of technical hurdles that I'm struggling to overcome. I've been closely following the official tutorial but have hit roadblocks that I hope someone here might have insights into.

  1. AxiosError: Request failed with status code 403 - This error pops up during the Data & Derivatives step of building my Viewer. Despite following the tutorial steps and ensuring my bucket name is unique, the issue persists, similar to the problem described here: StackOverflow Thread.

  2. Access Token Retrieval Issue - Both my implementation and the complete example from the official GitHub repository (https://github.com/autodesk-platform-services/aps-simple-viewer-nodejs) are throwing an "Could not obtain access token. See the console for more details", and I can't seem to upload my own model and the example model into the Viewer.

Has anyone faced these issues and resolved them? I'd greatly appreciate any guidance, insights, or resources you could share to help me move forward with my dissertation project.

Thank you in advance for your assistance!

Upvotes: 1

Views: 124

Answers (1)

TimmyTim
TimmyTim

Reputation: 86

I'll answer your questions in the order asked:

  1. The Axios error specifies that you don't have permission to access a specified resource. In this case, it could be your bucket name. You mentioned that your bucket key is unique. You could try two issues to try and fix this issue:

Try ensuring that your bucket name has ONLY small letters and the possible values: ( -_.a-z0-9 ). Secondly, you can try not specifying your bucket name and letting the application specify the bucket name. The tutorial states that a bucket specifies a bucket name for you if you forget to set one. Just remember to note down the name.

  1. It seems APS can't verify your app credentials which essentially are the clientId and client secret hence it can't grant an access token for you to access the needed APIs to implement your workflow. The solution would be for you to set your credentials on the .env file which should be within the project folder. Ensure you set your clientId and client secret in the .env file as follows:

APS_CLIENT_ID= "your client-id"

APS_CLIENT_SECRET= "your client-secret"

Upvotes: 0

Related Questions