node.js - Unable to get Token from oauth2 office365 calendar API -


i not able token office365 calendar api,from last 7 8 months working getting error "expecting array or iterable object got [object null]".

you guys can see code here

 var oauth2 = require("simple-oauth2")(configoutlookcredentials);  var scopes = ["openid","offline_access","profile",     //here 'profile' added bz not able getting emailid in function getemailfromidtoken.    "https://outlook.office.com/mail.read",    "https://outlook.office.com/calendars.readwrite"  ];  function gettokenfromcode(auth_code,callback) {    logger.messagequeuelog.log("info","auth_code: "+auth_code+" || redirecturi: "+redirecturi+" || scopes: "+scopes);    oauth2.authcode.gettoken({       code: auth_code,       redirect_uri: redirecturi,       scope: scopes.join(" ")    }, function(error, result) {     logger.messagequeuelog.log("info","error: "+util.format('%j',error.message)+" || result: "+util.format('%j',result));     if (error) {          return callback(error,null);     } else {          var token = oauth2.accesstoken.create(result);           return callback(null,token);     }   }); } 

i getting code after redirecting rediredct url , same code passing above function "gettokenfromcode" ,still m getting error i.e " expecting array or iterable object got [object null]".

kindly me figure out issue. in advance.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -