Single Sign-On gives 302 errors for all slave sites
denney - January 26, 2007 - 13:13
| Project: | Shared Sign-On |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
Description
When using the gsitemap module in a multi-site configuration, the master site works fine but the slave sites return a 302 (Moved Temporarily) error at Google when submitting the sitemap.
The problem stems from the fact that the Single Sign-On module redirects traffic to the master site to login.

#1
the same thing happens with feeds. The slave site feeds return errors in feedburner, google reader and most online feed parsers because of the redirect. There should be some kind of setting to disable single sign on for some pages..
#2
The same happens for *any* URL on the subsites!
People can't surf my subsites!
I have installed singlesignon together with the 'multidomain' module.
Everything seems OK when I surf the sites from my desktop,
but my users can't see the sites.
To reproduce the error, all I need is to SSH to my server, and issue the following commend:
wget .
# wget directory.levavie.com
--13:25:41-- http://directory.levavie.com/
=> `index.html.1'
Resolving directory.levavie.com... done.
Connecting to directory.levavie.com[209.59.178.5]:80... connected.
HTTP request sent, awaiting response... 302
Location: http://www.levavie.comhttp://www.levavie.com/singlesignon/initial_check?... [following]
http://www.levavie.comhttp://www.levavie.com/singlesignon/initial_check?slave_session=161be0cf4d4c465bb4d43bbb92d2dedc&singlesignon_dest=http%3A%2F%2Fdirectory.levavie.com%2F: Bad port number.
It seems singlesignon_init is called TWICE.
#3
#4
I've tried to implement a temporary solution by deleting the duplicate url prefix inside the singlesignon_goto function:
<?php
function singlesignon_goto($uri) {
$master_url = variable_get('singlesignon_master_url', '');
/* Delete duplicate URLs, if any */
if (substr_count ($uri, $master_url) > 1) {
$uri = substr ($uri, strlen ($master_url));
}
/* End new code */
header('Location: ' . str_replace(array("\r","\n"), '', $uri));
exit;
}
?>
but now I get a different error: 'redirection cycle detected'.
# wget http://directory.levavie.com--14:54:35-- http://directory.levavie.com/
=> `index.html'
Resolving directory.levavie.com... done.
Connecting to directory.levavie.com[209.59.178.5]:80... connected.
HTTP request sent, awaiting response... 302
Location: http://www.levavie.com/singlesignon/initial_check?slave_session=f5f04e0e... [following]
--14:54:36-- http://www.levavie.com/singlesignon/initial_check?slave_session=f5f04e0e... => `initial_check?slave_session=f5f04e0e34f4af9954c57ff9a9ab882f&singlesignon_dest=http%3A%2F%2Fdirectory.levavie.com%2F'
Resolving www.levavie.com... done.
Connecting to www.levavie.com[209.59.178.5]:80... connected.
HTTP request sent, awaiting response... 302
Location: http://directory.levavie.com/ [following]
http://directory.levavie.com/: Redirection cycle detected.
#5
This was happening to me with feeds. Very frustrating! To fix, I just added:
// If it's a request for a feed, do nothingif ($start=strpos($_SERVER['REQUEST_URI'], 'feed') || $start=strpos($_SERVER['REQUEST_URI'], 'rss.xml')) {
return null;
}
to the very top of singlesignon_init(). Hope this helps! Note: version 4.7
#6
I have a fix for this; you can get it from my site (along with a brief explanation of the problem and the fix).
#7
Confirming and subscribing.
#8
Confirmed thin bug for both Drupal version 4.7 and version 5.
#9
This is a duplicate of http://drupal.org/node/170001