Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

serviceValidate call broken on vanilla CAS #2

Merged
merged 1 commit into from

2 participants

@stuartf

I found that the serviceValidate call wasn't working against our local vanilla CAS install, the error looked like:

{ code: 'INVALID_REQUEST', '$t': '\'service\'and\'ticket\'parameters are both required' }

Changing the request to a GET and moving the body from the POST to query parameters seems to fix it.

@grahamb
Owner

Interesting… POST is the default for our implementation, but GET also works.

@grahamb grahamb merged commit a6f3cf4 into sfu:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 5, 2013
  1. @stuartf
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/cas-sfu.js
View
9 lib/cas-sfu.js
@@ -29,15 +29,14 @@ CAS.prototype.validate = function(ticket, callback) {
delete service.search;
service = url.format(service);
- bodystr = 'ticket=' + ticket + '&service=' + service;
+ bodystr = '?ticket=' + ticket + '&service=' + service;
if (this.options.allow) {
bodystr += '&allow=' + this.options.allow;
}
// call /validate with the ticket & service and call the callback
- request.post({
- uri: this.options.casBase + this.options.validatePath,
- body: bodystr
+ request.get({
+ uri: this.options.casBase + this.options.validatePath + bodystr
}, function(err, response, body) {
if (err) {
// do something
@@ -139,4 +138,4 @@ module.exports.getMiddleware = function(options) {
res.redirect(url.format(redirectUrl));
}
};
-};
+};
Something went wrong with that request. Please try again.