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

TypeError [ERR_INVALID_URL]: Invalid URL: #6

Open
milkteanosugar opened this issue Aug 6, 2020 · 1 comment
Open

TypeError [ERR_INVALID_URL]: Invalid URL: #6

milkteanosugar opened this issue Aug 6, 2020 · 1 comment

Comments

@milkteanosugar
Copy link

Hello,

I received the following error when I tried to login to the page http://localhost:3004/:

TypeError [ERR_INVALID_URL]: Invalid URL:
at onParseError (internal/url.js:257:9)
at new URL (internal/url.js:333:5)
at module.exports.authenticateAction (C:\Users\abc\Desktop\authentication\cas-server-mock\lib\controller.js:29:21)
at Layer.handle [as handle_request] (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\express\lib\router\layer.js:95:5)
at C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\express\lib\router\index.js:281:22
at Function.process_params (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\express\lib\router\index.js:335:12)
at next (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\express\lib\router\index.js:275:10)
at SendStream.error (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\serve-static\index.js:121:7)
at SendStream.emit (events.js:315:20)
at SendStream.error (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\send\index.js:270:17)
at SendStream.onStatError (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\send\index.js:421:12)
at next (C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\send\index.js:735:16)
at C:\Users\abc\Desktop\authentication\cas-server-mock\node_modules\send\index.js:743:23

The user.json file I created was like this:
[
{
"name": "001",
"attributes": {
"stringAttribute": "value",
"arrayAttribute": "arrayValue"
}
}
]

I didn't config any other things. Could you please give me some instructions about how to solve this error?

Thank you so much!

@maxime-beguin
Copy link
Contributor

Hello!

CAS protocol expects a service parameter when accessing the authentication page which is the URL of the page to redirect when authenticated.
Try accessing the authentication page with service parameter. Something like: http://localhost:3004/?service=http://localhost:3000/example

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