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

Getting error Cannot read property 'authenticationfailure' of undefined #10

Open
ghost opened this issue Apr 23, 2016 · 2 comments
Open
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Apr 23, 2016

Hi,

After successfully login to cas and redirect back, getting below error again and again while accessing api.

[2] [TypeError: Cannot read property 'authenticationfailure' of undefined]
[2] [Error: CAS authentication failed.]
My service is pointing to localhost.
Is there a way to debug ?

@jonalbertini
Copy link

jonalbertini commented Nov 4, 2016

Same problem :

TypeError: Cannot read property 'authenticationfailure' of undefined                                                                                   
    at /home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/cas-authentication/index.js:78:57                                                    
    at Parser.<anonymous> (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/xml2js/lib/xml2js.js:489:18)                                     
    at emitOne (events.js:96:13)                                                                                                                       
    at Parser.emit (events.js:188:7)                                                                                                                   
    at Object.onclosetag (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/xml2js/lib/xml2js.js:447:26)                                      
    at emit (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/sax/lib/sax.js:640:35)                                                         
    at emitNode (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/sax/lib/sax.js:645:5)                                                      
    at closeTag (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/sax/lib/sax.js:905:7)
    at Object.write (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/sax/lib/sax.js:1449:13)                                                
    at Parser.exports.Parser.Parser.parseString (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/xml2js/lib/xml2js.js:508:31)               
Error: CAS authentication failed.                                                                                                                      
    at /home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/cas-authentication/index.js:92:37                                                    
    at Parser.<anonymous> (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/xml2js/lib/xml2js.js:489:18)                                     
    at emitOne (events.js:96:13)                                                                                                                       
    at Parser.emit (events.js:188:7)                                                                                                                   
    at Object.onclosetag (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/xml2js/lib/xml2js.js:447:26)                                      
    at emit (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/sax/lib/sax.js:640:35)                                                         
    at emitNode (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/sax/lib/sax.js:645:5)                                                      
    at closeTag (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/sax/lib/sax.js:905:7)                                                      
    at Object.write (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/sax/lib/sax.js:1449:13)                                                
    at Parser.exports.Parser.Parser.parseString (/home/jonas/Documents/Node/MKBrowser/cas_test/node_modules/xml2js/lib/xml2js.js:508:31)

I've made a console log of the result object and I've got :

{"html":{"head":{"title":"404 Not Found"},"body":{"h1":"Not Found","p":"The requested URL //serviceValidate was not found on this server."}}}  

so, obviously no result.serviceresponse.authenticationfailure...

I suspect an parse error form index.js Line 67. but can't resolve it.

@kayleecodes1 kayleecodes1 self-assigned this Feb 8, 2017
@kayleecodes1
Copy link
Owner

kayleecodes1 commented Feb 9, 2017

I'm doing a rewrite of this module (with no API-breaking changes) and I'm going to validate the structure of the CAS server's response. All this will do it provide a more useful error message, though.

If the CAS server in the test cases was operating correctly and on the correct version, then this might be a problem with slashes. I'll be properly building and checking my request URLs in the new version.

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

No branches or pull requests

2 participants