Does anyone knows if there is a document about oAu...
# suitescript
a
Does anyone knows if there is a document about oAuth 2.0 for RESTlets ?
b
which part are you stuck on
a
I did solve it, thanks.
b
Tell me your thoughts on netsuites oauth 2 authentication after 7 days
a
I can already tell you tho... you send a request and it return bad request, send another request and it goes through. send another request and again you get bad request and it works next time... crazy stuff... but this is for a customer who is going to use a Python Script.. they will find out they would need to tweak that script a little bit... hahaha
b
im referring to the refresh token expiring
a
With Python is possible to automate the whole process and issue a new token each time...
b
Getting new access tokens is normal, getting a new refresh token is not
im now extra interested in hearing about your oauth2 now that your refresh token expired
a
@battk This is not for my usage, it was a customer request and they would be using a Python Script. What I can tell you is, after a week I can still open my postman collection and request a new token and still able to hit the end point and get my data. No entirely sure what do you mean by new refresh token... I do have to request a new token in Postman but I do not need to touch NetSuite for anything.
There are 2 tokens involved in netsuites oauth 2 an access token to authenticate and expires in an hour and a refresh token which is uses to get new access tokens and expires in 7 days
You get the refresh token by a browser based flow which is supposed to have a user click an allow button
You wouldnt normally want to do that in a script
a
@battk I understand by Python is able to do the whole thing, including emulating a browser and getting the refresh token.
k
@battk can 2FA be handled with Python script?
b
i personally wouldnt bother, but you probably want to start looking for a python library that supports totp
👍 1