I read some of the threads here about OAuth2.0 and...
# suitescript
m
I read some of the threads here about OAuth2.0 and I asked about it before, I know the Code Grant Flow is weird, but we have to use it as our client is not able to implement OAuth1.0/TBA. I got it working from Postman, and also able to do it manually but I can't do it programmatically, specially this step https://system.app.netsuite.com/app/help/helpcenter.nl?fid=section_158081944642.html because it requires a browser or user interaction. How do you do that step from the code?
b
that step is not designed to work programmatically
m
but if I did it manually, then used the code to get an access_token, it doesn't allow fetching a new one, you can use it once I guess
b
the access token is the uninteresting part
they last an hour
you want the refresh token, which lasts a week
and can be used to get new access tokens
m
what happens after the week
you get the code manually again?
b
correct
m
I think we should sue Oracle
b
and i use the word want loosely here, you want to be using TBA
m
It is an integration with the client's account on SalesForce, and they said they can't use it from SalesForce, not sure why
Will return back to them
Thanks very much ❤️
b
im guessing they tried and failed to implement TBA in apex
its possible, but requires understanding how Oauth 1 works and how to implement it
i know of no library that would do it for them
m
so they will have to do it manually, will discuss it with them, and maybe they could make a second search to find a library
m
I can confirm it is possible to get OAuth1.0 working in Apex. I worked with our salesforce dev and we got there
Use this tool http://lti.tools/oauth/, click create your own and use a hardcoded nonce and timestamp
Log every step of the way and make sure the output in apex matches what the tool shows
Until you can get a signature that matches
m
Thanks very much, I will send this to them