Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

problem with app-bom-master and app-stl-viewer-master samples

matthias_gubsch641matthias_gubsch641 Member, Developers Posts: 6 ✭✭
hallo,

i'm trying to understand the samples of node.js applications. i tried app-bom-master and app-stl-viewer-master.
the readme explains very well how to install the applications, so i was successfull in adding these applications to my onshape session.

if i try to use them i run in both cases in the same problem within the first "$.ajax" call:

Cannot read property 'accessToken of undefined

something i did was wrong, but i have no idea what. i didn't also no information in the documentation ...

does anybody has the same problem? any solutions idea?


thanks

matthias
Tagged:

Best Answer

  • matthias_gubsch641matthias_gubsch641 Member, Developers Posts: 6 ✭✭
    edited March 2017 Answer ✓
    thanks mbattistello!

    but clientID/clientSecret was correct, this piece of code is well documented.
    in the meantime we figured out the problem, and if i read all the hints more carefully, i could have known ...
    the problem was, i have defined the wrong iframe URL. i followed the gray sample text und didn't not add /oathSignin on the end of this definition. that's i never reached the login part of the sample code

    i think it may be a good idea to add this as a comment to the REDME.md

    kind regards

    Matthias

Answers

  • mbattistellombattistello Member, Developers Posts: 51 ✭✭
    I dont think the OAuth token is working. Did you setup the clientID and clientSecret fields in the authentication.js files?

    Can you post more of the error trace?
  • matthias_gubsch641matthias_gubsch641 Member, Developers Posts: 6 ✭✭
    edited March 2017 Answer ✓
    thanks mbattistello!

    but clientID/clientSecret was correct, this piece of code is well documented.
    in the meantime we figured out the problem, and if i read all the hints more carefully, i could have known ...
    the problem was, i have defined the wrong iframe URL. i followed the gray sample text und didn't not add /oathSignin on the end of this definition. that's i never reached the login part of the sample code

    i think it may be a good idea to add this as a comment to the REDME.md

    kind regards

    Matthias
  • DavidPhillipsDavidPhillips Member, Developers Posts: 8
    Aha, thanks for posting this. I had the exact same problem trying out those 2 demos and was unsure what was going on. I too just followed the grey default text in the iframe input field ("https://example.com") and simply pasted the herokuapp url, not realizing "/oauthSignin" was supposed to be appended at the end. In hindsight, the sample instructions do mention that as a "URL for sign-in". I guess it could be a little more clear that that goes in the iframe field.

    Anyway, works now thanks to your tip.
    Clara.io Developer
Sign In or Register to comment.