【问题标题】:cannot authenticate crowd with Atlassian-crowd-client package无法使用 Atlassian-crowd-client 包对人群进行身份验证
【发布时间】:2018-04-11 06:24:19
【问题描述】:

我正在使用sails.js 和Atlassian-crowd-client 包在人群中进行身份验证。但它返回错误:Error: Invalid Response from Crowd, expecting JSON. 这是我的代码,我不知道问题出在哪里。如果有人提供帮助,我将不胜感激。

var atlassianCrowdClient = require('atlassian-crowd-client');
var crowd = new atlassianCrowdClient({
  baseUrl: 'http://my-host/crowd/console/login.action',
  application: {
    name: 'app-name',
    password: 'app-password'
  },
  "Content-Type":"application/json",
  "Accept": "application/json"
});

module.exports = {            
  show: function (req, res) {crowd.session.create({'username':'my-username','password':'my-password'})
    .then(function (session) {
      console.log('Crowd SSO token is ' + session.token);
    })
    .catch(function(err) {
        console.log('err: ' + err)
    })

  }

};

【问题讨论】:

    标签: json authentication sails.js atlassian-crowd


    【解决方案1】:

    我认为您使用的 baseURL 是错误的。应该是

    baseUrl: 'https://crowd.example.com/'

    请看这里: https://www.npmjs.com/package/atlassian-crowd-client

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-17
      • 2017-11-24
      • 1970-01-01
      • 1970-01-01
      • 2018-06-08
      相关资源
      最近更新 更多