Craig
07/07/2025, 1:24 PMconst getGCPBearerToken = () => {
const guid = 'custsecretgcp_jwt_service';
const secretKey = crypto.createSecretKey({
guid: guid,
encoding: crypto.Encoding.UTF_8
});
return secretKey
}
Is this the correct way to get a value from the NetSuite API secrets?
I don’t think it’s possible to log the returned key so it’s very hard to see why I’m getting a HTTP 401 when using the returned value as bearer token.
Replacing this code with the token (as a string) works, that means the issue is with the API secret.
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer crypto.SecretKey"
},
Craig
07/07/2025, 2:32 PMharing salibat
07/10/2025, 6:31 AM