I am performing GET Request to the Authorization E...
# integrations
k
I am performing GET Request to the Authorization Endpoint to Authenticate netsuite using OAuth2.0, I have created a suitelet and trying to authenticate, after hitting the URL as per mentioned in suiteAnswer(id-91339), BUT, I in my case the Consent screen Not getting Open in my netsuite login? Can anybody help me on this steps to authenticate using OAuth2.0 . Thanks In Advance!
k
Thank you so much for your reply. Yes, i have tried using postman and it worked successfully. But i was trying using suitelet by the steps mentioned in suiteAnswer(id-91339), there my suitelet in not able to open the Consent screen as mentioned in the description over there. Thanks In advance!
b
what code are you using for the redirect
k
I have create this url based on the steps mentioned in the suiteAnswers: var url = "https://<ACCOUNT_ID>.app.netsuite.com/app/login/oauth2/authorize.nl?"; url+= "response_type=code&"; url+= "client_id=71179ab7e2a1b5d433967eb0f5652b232883285b0a291f905c65f30228&"; url = url+ "redirect_uri=https://<ACCOUNT_ID>.app.netsuite.com&"; url+= "scope=restlets&"; url+= "state=wmnvbdiplaghujagrtewqnza";
and Header given as : application/x-www-form-urlencoded and used nlapiRequestURL to trigger this url. and in response i am just getting Netsuite login page in in Execution logs.
b
thats not a redirect
and thats not how you should encode parameters
k
ohh... so can you please guide me for the same.. what should be my steps?
b
the first step of the oauth 2 grant flow is a redirect
you need to redirect the user to a different url
k
basically i am trying to trigger an restlet using suitelet by OAuth 2.0
b
sorta seems pointless
oauth 2 requires a user to grant access
k
ohk. i will try once as u suggested.
i think my approach is wrong.. i will do it once again.
b
if you only need to access the code for the restlet from the suitelet, you can include the restlet code as a library and use it directly
suitelet to restlet schemes tend to be bad architecture
k
yes i got it... once last question, can you please suggest me something from where i get to know how to properly encode its parameters?
things like redirect.redirect(options) will do the encoding for you if you use the parameters key
k
Thank you so much. I will test with this and go with the things you have mentioned. Thanks again.!
Thanks battk. I am able to redirect now. thank u so much for your help.