is it possible to authenticate using an OAuth inte...
# suitescript
b
is it possible to authenticate using an OAuth integration to a restlet? not TBA
b
for some reason, although im authenticating and get access token, i still get unauthrized
c
Your integration record is configured correctly? Your RESTlet audience includes this role?
b
indeed all roles and all employees are allowed to execute the restlet
do i need to send some specific header or something.. it's just a simple GET restlet that returns dummy data
c
What are you doing with the token you receive from the token endpoint?
b
Send it as Bearer
c
Have you reviewed the Detail column of the Login Audit Trail to see if there's any helpful context there?
b
i can't see this field. but looks like authentications are succeesful
c
When you select Administration & Controls > Audit > View Login Audit Trail, before you click Submit, add "Detail" as a column under the Results subtab. This should give you extra context on login attempts. You can filter down to that RESTlet if need be. when you say "looks like authentications are successful" what do you mean?
b
@Clay Roper Okay.. I see that two records are added at the same time - one is about successful login, then another one with email,user,role fields empty and the details says "InsufficientPermissions"
is there a special permission needed when running restlets?
b
b
@battk @Clay Roper I am able to authenticate and also run suiteql queries using the access token generated. But probably there is a permission required to execute restlets and i need to give it to my integration user. I Saw the
Setup > SuiteScript
permission, is it the one required?
b
no
b
so what can i do? super weird. I am able to run API calls (OAuth 2.0 token is valid) but the restlet returns error, probably due to permissions issue..
c
@Bit Have you read the article @battk linked?
b
@Clay Roper indeed
My integration user (the one that the the access token have its context) has these permissions
b
thats pretty much it, there are no other permissions required to access a restlet
you can log in via the ui and use the internal url in a browser to see that your user/role has access to the restlet
if that works, then accessing the external url just consists of adding the permission to use oauth 2
b
i will do so, good idea
b
you will also want to make extra sure that your user / role is what you think they are
usually consists of getting a new token, and verifying that the user/parameters are correct
but can also consist of using the The REST Roles Service if you wish to do it progamatically
b
thanks a lot, i will check and update! @battk
@battk @Clay Roper just found this.. FYI
it fixed my problem
👍 1