Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpcode = 401 #18

Open
iamstd opened this issue Jul 5, 2018 · 1 comment
Open

httpcode = 401 #18

iamstd opened this issue Jul 5, 2018 · 1 comment

Comments

@iamstd
Copy link

iamstd commented Jul 5, 2018

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
Copy link

sliontc commented Apr 18, 2020

I got same error. Hope someone can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants