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

matthias_gubsch641
matthias_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_gubsch641
    matthias_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

  • mbattistello
    mbattistello Member, Developers Posts: 52 EDU
    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_gubsch641
    matthias_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
  • DavidPhillips
    DavidPhillips 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