Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Netsuite Connector Authentication Query

Sivagami
Valued Contributor
Valued Contributor

Netsuite offers Oauth2 as Authentication for their REST endpoints, With 2 grant flows

1) Authorization code

2) Client credentials

https://medium.com/entech-solutions/how-to-use-netsuite-rest-api-with-oauth-2-and-c-net-126ac118919c 

Limitation with Authorization code based set up is every 7 days refresh token expires and manual intervention is required to regenerate the code. And hence update the connection json. Operationally this is not an acceptable solution.

Secondly, with client credentials based auth, the issue is with the encryption that needs to be done. How do we achieve it in Saviynt connection json? I don't find any reference documents or a working model around Netsuite integration. All the posts around Netsuite are kind of unanswered at this point. Appreciate the insights.

-Siva

2 REPLIES 2

adarshk
Saviynt Employee
Saviynt Employee

Please check this JSON:

    "authentications": {
        "userAuth": {
            "authType": "oauth2",
            "url": "https://xxx/services/rest/auth/oauth2/v1/token",
            "httpMethod": "POST",
            "httpParams": {
                "grant_type": "refresh_token",
                "refresh_token": "xxxx"
            },
            "httpHeaders": {
                "contentType": "application/x-www-form-urlencoded",
                "Authorization": "Basic xxx"
            },
            "httpContentType": "application/x-www-form-urlencoded",
            "expiryError": "INVALID_SESSION_ID",
            "authError": [
                "INVALID_SESSION_ID"
            ],
            "timeOutError": "Read timed out",
            "retryFailureStatusCode": [
                401,
                403
            ],
            "errorPath": "errorCode",
            "maxRefreshTryCount": 5,
            "tokenResponsePath": "access_token",
            "tokenType": "Bearer",
            "accessToken": "Bearer abcd"
        }
    }
}

For other use cases you can refer the REST guide to get sample JSONS

Sivagami
Valued Contributor
Valued Contributor

Thanks Adarsh for the response. This uses the oauth authorization code flow to generate refresh token. Creating connection json isn't a problem here. But this refresh token expires in 7 days per netsuite documentation and we need to provide manual consent again which is my problem. 

We can't keep updating the connection json every week right. Looking for option to tackle this problem or use other authentication method netsuite offers. Please assist.

-Siva