How to check oauth credentials are valid or not in Netsuite? -
i access token , secret, not working times . getting error invalid login attempt. don't know how solve issue.
i have credentials oauth , these
- consumer key
- consumer secret
- account id
- token id
- token secret
- script id
- deployment id
i want know oauth credentials group or individual valid or not .
i think way hit suitetalk or restlet.
if using restlet, must ensure user has access restlet in deployment options.
i have working code using java (using scribe java
library) can found here
main method:
oauthconfig authconfig = new oauthconfig("consumer_key", "consumer_secret", null, signaturetype.header, null, null); token token = new token("token_id", "token_secret"); oauth10aserviceimpl auth10aserviceimpl = new oauth10aserviceimpl(new netsuiteapi(), authconfig); oauthrequest request = new oauthrequest(verb.get, "restlet_url"); request.setrealm("ns_account_id"); auth10aserviceimpl.signrequest(token, request); response response = request.send();
also need write netsuiteapi class extending defaultapi10a
import org.scribe.builder.api.defaultapi10a; import org.scribe.model.token; public class netsuiteapi extends defaultapi10a { @override public string getaccesstokenendpoint() { // todo auto-generated method stub return null; } @override public string getauthorizationurl(token arg0) { // todo auto-generated method stub return null; } @override public string getrequesttokenendpoint() { // todo auto-generated method stub return null; } }
Comments
Post a Comment