Я хочу получить доступ к API Gmail с помощью NodeJS.
Я использую межсерверный подход (см. это), но когда я выполняю код ниже, я получаю backEndError, код 500 от Google API.
Любые идеи?
var authClient = new google.auth.JWT(
'email',
'key.pem',
// Contents of private_key.pem if you want to load the pem file yourself
// (do not use the path parameter above if using this param)
'key',
// Scopes can be specified either as an array or as a single, space-delimited string
['https://www.googleapis.com/auth/gmail.readonly']
);
authClient.authorize(function(err, tokens) {
if (err)
console.log(err);
gmail.users.messages.list({ userId: 'me', auth: authClient }, function(err, resp) {
// handle err and response
if (err) {
console.log(err);
});
access_denied Requested client not authorized.
- person webjay   schedule 15.09.2014new google.auth.JWT
? Я использовалkey.client_email
в качестве первого параметра,null
в качестве второго,key.private_key
в качестве третьего, а затем области. Где мне указать, от какого пользователя я должен получать почту? Мне нужно получать электронные письма с разных учетных записей внутри домена. - person Kunok   schedule 09.09.2016