401 on creating session in ViewerAPI localhost

On the viewer API I have literally just copy and pasted the snippet of code for creating a viewport and session, and then changed the values in the objects to match what I find in the embed tab for my grasshopper model via the shapedriver dashboard.

    this.viewPort = await createViewport({
    console.log("viewport initialised... ");
    this.session = await createSession({
      ticket: 'ticket from embed tab',
      modelViewUrl: 'https://sdr7euc1.eu-central-1.shapediver.com'

I have on my whitelist localhost:4200 which I am dev’ing from at the moment.

On the console I see

Not sure what the issue is here. Let me know any other details.

We have recently introduced a strong security measure which is active by default for your models. We will change the setup in an upcoming update as it has created some friction. In the meanwhile, you might need to switch the “Require strong authorization” checkbox off in the embedding settings of your account, as well as individually for each model, in the embedding tab of the model edit page.

thanks this indeed was the problem

1 Like