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
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

zis - February 12, 2007 - 20:37

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

levavie - March 14, 2007 - 18:27
Priority:normal» critical

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

levavie - March 14, 2007 - 18:28
Title:Single Sign-On + gsitemap = 302 (Moved Temporarily) error at Google» Single Sign-On gives 302 errors for all slave sites

#4

levavie - March 14, 2007 - 19:56

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

aspankie - May 21, 2007 - 19:54
Version:5.x-1.x-dev» 4.7.x-1.x-dev

This was happening to me with feeds. Very frustrating! To fix, I just added:

  // If it's a request for a feed, do nothing
if ($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

starkos - August 24, 2007 - 00:58

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

Benjamin Melançon - October 10, 2007 - 01:57

Confirming and subscribing.

#8

Benjamin Melançon - October 10, 2007 - 01:59
Version:4.7.x-1.x-dev» 5.x-1.x-dev

Confirmed thin bug for both Drupal version 4.7 and version 5.

#9

wayland76 - February 25, 2008 - 03:52
Status:active» duplicate

This is a duplicate of http://drupal.org/node/170001

 
 

Drupal is a registered trademark of Dries Buytaert.