You need to sign in to do that
Don't have an account?
Shweta Tyagi
How to generate 0auth signature for netsuite in apex class.
I am using Following Code: generateSignature(algorithmName, input, consumersecret,tokensecret);
public static String generateSignature(String algorithmName, String input, String consumerSecret, String tokenSecret) {
Blob sig = Crypto.generateMac(algorithmName, Blob.valueOf(input), Blob.valueOf(consumerSecret + '&' + tokenSecret));
String signature = EncodingUtil.base64encode(sig);
System.debug('##### signature: ' + signature);
return signature;
}
But from this, I got the error when signature contains '+' plus operator. Please help to find the solution.
public static String generateSignature(String algorithmName, String input, String consumerSecret, String tokenSecret) {
Blob sig = Crypto.generateMac(algorithmName, Blob.valueOf(input), Blob.valueOf(consumerSecret + '&' + tokenSecret));
String signature = EncodingUtil.base64encode(sig);
System.debug('##### signature: ' + signature);
return signature;
}
But from this, I got the error when signature contains '+' plus operator. Please help to find the solution.
Sorry for this issue you are encountering.
May I suggest you please refer to below links with a similar discussion which might help you further with the above issue.
- https://salesforce.stackexchange.com/questions/97646/oauth-signature-generation
- https://developer.salesforce.com/forums/?id=906F00000005IHeIAM
Hope this helps.Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra