Using play-ws 2.4.6 and the NingWSClient, is it possible to set the realm in the Authentication header? I am trying to hit NetSuite's REST 1.0 API which requires the OAuth realm parameter to be set.
Here is some sample code I am currently using:
val requestToken = RequestToken("*****", "*****")
val consumerKey = ConsumerKey("*****", "*****")
val oauthCalc = OAuthCalculator(consumerKey, requestToken)
val request: WSRequest = ws.url("https://rest.na1.netsuite.com/app/site/hosting/restlet.nl?script=554&deploy=1")
.withHeaders("Content-Type" -> "application/json").sign(oauthCalc)
request.get()
Netsuite does not recognize the OAuth request without the realm, reporting: USER_ERROR header is not NLAuth scheme. Using the Postman rest app, I was able to reproduce the same error from NetSuite when a realm is not supplied. Then when adding the realm in postman the request went through successfully.
Authorization
header – TonyH