Closed (won't fix)
Project:
CAS
Version:
7.x-1.x-dev
Component:
CAS
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Sep 2014 at 19:00 UTC
Updated:
15 Sep 2014 at 20:35 UTC
Jump to comment: Most recent
Hi,
I get a redirect loop when attempting to log in with CAS. I'm using Drupal 7.31, phpCAS 1.3.3, PHP 5.3.3, and CAS module v7.x-1.x. I'm using the CAS 2.0 protocol, and I've attached the CAS module's log below of the loop.
| Comment | File | Size | Author |
|---|---|---|---|
| casloop.txt | 167.97 KB | dobie_gillis |
Comments
Comment #1
bkosborneHow the login "initiated" on the Drupal site?
Comment #2
dobie_gillis commentedIt's an href pointing to
/cas.Comment #3
bkosborneYes you certainly have a redirect loop going on there.
For sanity, I just tested this myself and didn't have a problem. I signed out locally, constructed a URL like this: http://sandbox.local/cas?destination=node/12. And I was properly signed on and then finally redirected to /node/12.
Do you have any other modules enabled that could potentially be messing w/ login? Make sure Cookies are working? Your debug log indicates that after the user has returned to the site, phpCAS finds the service ticket parameter, validates it, and then reloads the page (removing the service ticket parameter from the URL). On the next page load, phpCAS for some reason does NOT recognize that it had previously logged the user in, so it tries to log them in once more.
Comment #4
dobie_gillis commentedThanks for helping me debug this. Cookies seem to be enabled and working (and this occurs in every browser I've tried), and if I manually construct a url like
/cas?destination=node/12, I still hit the loop. I'll keep looking.Comment #5
dobie_gillis commentedI've spent the last two days looking through all the CAS module and phpCAS code, and I can't figure out why
$_SESSION['phpCAS']['user']isn't getting set. So annoying.Comment #6
dobie_gillis commentedComment #7
dobie_gillis commentedComment #8
metzlerd commentedIn most cases this problem has been traced back to problems with session initialization due to some performance optimizing thing that we are not privy to. But to trace this back. Can you verify whether the phpCAS sample code (in a simple php environment) behaves properly on your server? This would help us understand if there is an underlying prolbem with the phpCAS libraries or if it related to the combination of modules that you might be using.
To start with make sure that you have a user account with a cas user name that you are filling in, and that php error reporting is turned on in your dev sites. (Also be checking the drupal logs after logging in). I would also recommend disabling any modules or features that might be changing the way session information is stored, or implement custom login hooks or redirects. Ideally we'd try a simple test with a vanilla drupal install in your enviornment with just the CAS module enabled.
Sorry this has been so frustrating for you.
Comment #9
dobie_gillis commentedI set up a test environment and ran the phpCAS sample code on the server I'm using - I was able to log in, log out, and there was no redirect loop.
It's good to narrow this down -- so now it's looking like this could be coming from the combination of modules I'm using, since I have other Drupal sites on this server working with CAS.
But then again, I have an instance of this site with CAS working on another server, with the same modules enabled. So I'm still puzzled.
Comment #10
dobie_gillis commentedThanks for the help Dave - I'll mark this as 'wontfix' since it seems to be an issue with either the code or the database of my site. Going to just rebuild the site now.