After upgrading simplesamlphp from 1.13.2. to 1.14.0, I'm now intermittently getting NOSTATE errors when I go to my site's /simplesaml folder.

SimpleSAML_Error_NoState: NOSTATE
Backtrace:
2 /var/simplesamlphp/lib/SimpleSAML/Auth/State.php:263 (SimpleSAML_Auth_State::loadState)
1 /var/simplesamlphp/modules/saml/www/sp/saml2-acs.php:78 (require)
0 /var/simplesamlphp/www/module.php:127 (N/A)

And I also get the same error when trying to login to my Drupal site with a federated login. If I go back and then try again sometimes it will let me login.

I followed the upgrade instructions for upgrading simplesamlphp.

Any help would be appreciated.

Thanks.
Cyndi

CommentFileSizeAuthor
#14 metadata.png122.01 KBgurunathan
#14 authentication.png125.17 KBgurunathan

Comments

cyndih created an issue. See original summary.

Stevel’s picture

Issue tags: -upgrade, -simplesamlphp, -NOSTATE

Is this still an issue for you? I'm currently running the latest version (1.14) without problems.

Perhaps the info on https://simplesamlphp.org/docs/development/simplesamlphp-nostate can help?

cyndih’s picture

I just tried with Simplesamlphp 1.14.4 and am still getting the NOSTATE errors.

Stevel’s picture

Does it work when you try the Simplesamlphp module itself? e.g. try to log in to your SP on /sites/all/libraries/simplesamlphp/module.php/core/authenticate.php

cyndih’s picture

No, that is when I get the NOSTATE errors. With the simplesamlphp module itself. It works with 1.13.2 though.

Stevel’s picture

Category: Bug report » Support request

The problem then is within the Simplesamlphp library, not in this module. Try to get the login working at /sites/all/libraries/simplesamlphp/module.php/core/authenticate.php, then this module should also work.

Stevel’s picture

Status: Active » Closed (works as designed)

Closing this ticket because there seems to be no problem with this module.

gurunathan’s picture

@Stevel,

I get the same error in our site when we click the site URL from a MS word or powerpoint hyperlink.

I created a ticket #2859075 related to this.

gurunathan’s picture

Status: Closed (works as designed) » Active
gurunathan’s picture

Line #215 in simplesamlphp_auth.module

$_simplesamlphp_auth_saml_attributes = $_simplesamlphp_auth_as->getAttributes();

This returns empty array. I think that's the reason for this issue.

pthornhi6’s picture

I am getting this same error. And my system DOES authenticate properly when used directly /module.php/core/authenticate.php?as=default-sp

gurunathan’s picture

My system also authenticate properly when used directly /module.php/core/authenticate.php?as=default-sp

snufkin’s picture

By authenticating correctly you mean you get the necessary attributes as well? If getAttributes returns an empty array, that suggests to me that the SimpleSAML library could not populate the attributes, and therefore Drupal can not identify the user. This means that the change is introduced by the library, not the module.

Does a reroll of the library to 1.13.2 fixes the issue?

gurunathan’s picture

StatusFileSize
new125.17 KB
new122.01 KB

@Sufkin,

I'm using libary version 1.13.2.

When I execute authenticate.php, I get the atttibutes. But I get error when I execute matadata.php. I have attached the screenshots. We get the error for the 'deafult-sp' instance only. We have two other instances 'stage-sp', 'live-sp'. We don't face the error with the metadata for this two instances.

snufkin’s picture

Status: Active » Postponed (maintainer needs more info)

Unfortunately thats impossible for me to debug as the problem is highly circumstantial. I'll put this to postponed unless you can figure out where in the module code the bug is and how the issue is reproducible for others.

gurunathan’s picture

The attributes arraqy was empty becuase it was mentioned NULL in 'config/authsources.php'.
'default-sp' => array(
...........
................
'attributes' => NULL,
);

I removed it. Now the Metadata page is loading fine. (https://example.com/simplesaml/module.php/saml/sp/metadata.php/default-s...).

But the issue is we redirect to the wrong page after login. But the user login happnes correctly in backend. So redirect URL is the only issue here. This is the the page to which the redirects happen after login.
https://example.com/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp

Another important thing:
Type site URL in browser => Redirect to SAML Login page => After login redirect to the correct page. (This flow is correct).
Click URL in MsWord document => Redirect to SAML Login page => After login redirect to the wrong page. (This flow is wrong).

Any idea?

gurunathan’s picture

Status: Postponed (maintainer needs more info) » Active
Stevel’s picture

Are you sure the link in your word document (visible if you hover the link text) has the same target as the URL you type in the browser? I don't see how a link from word could trigger different behavior from typing in the link in your browser directly.

gurunathan’s picture

@Stevel,

I use the same link in the word document

alvm’s picture

Hi, any solution to this?.

I'm having the same problem, my "/module.php/core/authenticate.php?as=default-sp" works ok.

The first login and logout also works fine, but after that I am getting the "SimpleSAML_Error_NoState: NOSTATE"

I've already tried different versions of simpleSamlPhp and module, simplesaml configuration and sql and memcache store.type .

Also I read and apply the recommendations of the simpleSamlPhp documentation without luck.

Anyone can point me in the right direction?

Thanks!