I'd like to use a JSON Web Token (JWT) to obtain for my server-based application an authorization token to send email.
In forming the jwtClaimSet I need to include: "iss", "scope", "aud", "exp" and "iat"
I have a question regarding "scope".
Out of these two, what should it be for sending email?
I'd like to use:
var request = require('/usr/local/lib/node_modules/request');
request(options, function (error, response, body) { ... }
var options = { ...};
contains:
method: "POST",
headers: "Content-Type": "application/x-www-form-urlencoded",
body: "encodedData", // Is this correct? What should it be?
grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer", // This one causes an error! How should I specify grant_type?
assertion: fullJWT // Where var fullJWT = encodedJwtHeader + "." + encodedClaim + "." + signature;
I get the error:
'{\n var fullJWT = encodedJwtHeader + "." + encodedClaim + "." + signature;\n}'
This message is very criptic and I need help. Will appreciate your responses as I've been debugging for the last three days!!