kayleecodes1 / cas-authentication

A CAS authentication library designed to be used as middleware for an Express server.
MIT License
73 stars 77 forks source link

httpcode = 401 #18

Open iamstd opened 6 years ago

iamstd commented 6 years ago

hi. thank your library for us to use cas anthentication. however, when i use this library like as your demo.

var session = require('express-session'); var CASAuthentication = require('cas-authentication'); var cas = new CASAuthentication({ cas_url: 'https://casdev.XXXXoffice.cn', service_url: 'http://localhost:3000', cas_version: '3.0', renew: false, is_dev_mode: false, dev_mode_user: '', dev_mode_info: {}, session_name: 'cas_user', session_info: 'cas_userinfo', destroy_session: false }); router.use(cas.bounce);

when i enter password and username, unfortunely, the error ocurs as following:

TypeError: Cannot read property 'serviceresponse' of null at /Users/zhengchunhua/xiaochengxu/node-cms/node_modules/cas-authentication/index.js:77:41 at Parser. (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/xml2js/lib/parser.js:303:18) at emitOne (events.js:96:13) at Parser.emit (events.js:188:7) at Parser.exports.Parser.Parser.parseString (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/xml2js/lib/parser.js:313:16) at Parser.parseString (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/xml2js/lib/parser.js:5:59) at exports.parseString (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/xml2js/lib/parser.js:354:19) at CASAuthentication._validate (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/cas-authentication/index.js:67:13) at CASAuthentication. (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/cas-authentication/index.js:345:18) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) Error: CAS authentication failed. at /Users/zhengchunhua/xiaochengxu/node-cms/node_modules/cas-authentication/index.js:91:37 at Parser. (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/xml2js/lib/parser.js:303:18) at emitOne (events.js:96:13) at Parser.emit (events.js:188:7) at Parser.exports.Parser.Parser.parseString (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/xml2js/lib/parser.js:313:16) at Parser.parseString (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/xml2js/lib/parser.js:5:59) at exports.parseString (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/xml2js/lib/parser.js:354:19) at CASAuthentication._validate (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/cas-authentication/index.js:67:13) at CASAuthentication. (/Users/zhengchunhua/xiaochengxu/node-cms/node_modules/cas-authentication/index.js:345:18) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) GET /activity/api?ticket=ST-284434-93adTmSO0pB5UQdARISn-sso01 401 19.356 ms - 12

can you give me some advise ?

sliontc commented 4 years ago

I got same error. Hope someone can help.