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? "scope": "https://www.googleapis.com/auth/gmail.send" "scope": "https://www.googleapis.com/auth/analytics.readonly" 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? uri: "https://www.googleapis.com/oauth2/v4/token", //uri: 'https://accounts.google.com/o/oauth2/auth', //uri: "https://accounts.google.com/o/oauth2/token", // Which one out of the above choices? 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!! -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/a7b85e1d-cd17-4f3c-ad2b-b40bf06385f8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
