I have correctly been able to use "OAuth 2.0 Web Server Authentication Flow" and now I'd like to switch to "OAuth 2.0 JWT Bearer Token Flow".
I wrote a test application in Node.js with the values two values:
audience: 'https://instance.salesforce.com'
and
uri: 'https://instance.salesforce.com/services/oauth2/token'
The response that is coming back is stating:
null
400
{"error":"invalid_grant","error_description":"audience is invalid"}
Also, when I look at the Salesforce Dashboard Login History, I can see "Failed: Audience Invalid".
The question I have is, how do I determine the correct 'audience' and 'uri' value. At the moment, I am using the sandbox.