LinkedIn API无法打开登录页面

时间:2018-08-16 12:12:21

标签: javascript node.js vue.js linkedin

Vue.js

 async signInWithLinkedIn() {
  console.log("Sign In Clicked!")
  try {
    const response = await CustomerProfileService.signInLinkedIn()
    if(response.data.error != null){
      this.error = 'Please try again.'
    }else{
      this.error = 'Successful.'
    }
  } catch (error) {
    //this.error = error.response.data.error
  }
}

Node.js

var Linkedin = require('node-linkedin')('aaaa', 'bbbb')
    async signInLinkedIn (req, res) {
        //var scope = ['r_basicprofile', 'r_emailaddress']
        // This will ask for permisssions etc and redirect to callback url.
        Linkedin.auth.setCallback('http://localhost:4172/linkedInCallBack')
        //Linkedin.auth.authorize(res, scope)
        Linkedin.auth.authorize(res)
    }

我正在使用node-linkedin包从用户那里获取一些LinkedIn数据。因此,当运行nodejs代码时,没有任何错误,但不会将我重定向到我将批准请求的登录页面。我怎样才能解决这个问题 ?先感谢您。

0 个答案:

没有答案