New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot integrate 1.15.0 with projects using Twig 2 #753

Closed
RinkAttendant6 opened this Issue Dec 21, 2017 · 10 comments

Comments

Projects
None yet
6 participants
@RinkAttendant6

RinkAttendant6 commented Dec 21, 2017

With SimpleSAMLphp 1.15.0, I cannot get the "Integrating authentication with your own application" steps working with my application that uses Twig 2.

I am using the Composer autoloader in my application and I've narrowed it down to the require line which tries to autoload Twig in my application's vendor dependencies (vendor) instead of from where SimpleSAMLphp is installed (/var/simplesamlphp).

require '/var/simplesamlphp/lib/_autoload.php';
$as = new \SimpleSAML\Auth\Simple('default-sp');
// also tried the old way: new \SimpleSAML_Auth_Simple('default-sp');

This is the error I get:

[Thu Dec 21 16:34:09.020522 2017] [php7:error] [pid 16036] [client <snip>] PHP Fatal error:  Uncaught Error: Cannot instantiate abstract class Twig_Test in /var/www/app1/vendor/twig/twig/lib/Twig/Extension/Core.php:203
Stack trace:
#0 /var/www/app1/vendor/twig/twig/lib/Twig/ExtensionSet.php(449): Twig_Extension_Core->getTests()
#1 /var/www/app1/vendor/twig/twig/lib/Twig/ExtensionSet.php(429): Twig_ExtensionSet->initExtension(Object(Twig_Extension_Core))
#2 /var/www/app1/vendor/twig/twig/lib/Twig/ExtensionSet.php(398): Twig_ExtensionSet->initExtensions()
#3 /var/www/app1/vendor/twig/twig/lib/Twig/Environment.php(936): Twig_ExtensionSet->getUnaryOperators()
#4 /var/simplesamlphp/vendor/twig/twig/lib/Twig/Lexer.php(382): Twig_Environment->getUnaryOperators()
#5 /var/simplesamlphp/vendor/twig/twig/lib/Twig/Lexer.php(68): Twig_Lexer->getOperatorRegex()
#6 /var/www/app1/vendor/twig/twig/lib/Twig/Environment.php(505): Twig_Lexer->__construct(Object(Twig_Environment))
#7 /var/www/app1/vendor/twig/twig/lib/Twig/Environment.php(561): Twig_Environment->tok in /var/www/app1/vendor/twig/twig/lib/Twig/Extension/Core.php on line 203

On the QA environment, I have tested SimpleSAMLphp 1.15.0 with the TestShib site and the admin interface works correctly, but our application crashes on all pages that require authentication with Shibboleth.

We have rolled back our production environment to SimpleSAMLphp 1.14 in the meantime as it works fine with our application. We really want to upgrade as the new version no longer relies on the mcrypt extension.

Any ideas?

@RinkAttendant6 RinkAttendant6 changed the title from Cannot integrate with projects using Twig 2 to Cannot integrate 1.15.0 with projects using Twig 2 Dec 21, 2017

@thijskh

This comment has been minimized.

Member

thijskh commented Dec 26, 2017

@Olimpiamagliulo This might be something for you to look at...

@macintoshplus

This comment has been minimized.

macintoshplus commented Jan 18, 2018

In my project, this dependency downgrade to 1.14 because the 1.15 version need twig 1.0.

I Suggest to move the requirement into suggest section ?

@macintoshplus

This comment has been minimized.

macintoshplus commented Feb 13, 2018

Any information for this issue?

@umpirsky

This comment has been minimized.

umpirsky commented Jun 24, 2018

Using this in combination with Twig >1.0 is blocked by composer constraints. Current version of Twig is 2.4.8.

@tvdijen tvdijen referenced this issue Sep 2, 2018

Closed

Support Twig 2 #918

@ofriedrich

This comment has been minimized.

ofriedrich commented Sep 3, 2018

In times of increasing number of packages supporting Twig 2 only it would be really nice if simpleSAMLphp would support it too.

For other people searching for a (temporary) solution: LightSAML - but does not support logout by default.

P. S. Not a good idea to switch back to 1.14 => see security issues!

@tvdijen

This comment has been minimized.

Member

tvdijen commented Sep 3, 2018

The main issue here is that Twig 2 requires PHP7 and SimpleSAML supports >=5.4.
Perhaps we can support both Twig 1 and 2, but that will require changes to the codebase, because it is currently incompatible with Twig 2.

@tvdijen

This comment has been minimized.

Member

tvdijen commented Oct 12, 2018

Right now, master should support Twig2-applications and a PR to backport this functionality to the 1.16 branch is awaiting review. Feedback would be very much appreciated!

@RinkAttendant6

This comment has been minimized.

RinkAttendant6 commented Oct 14, 2018

It looks like 1.17 is on track according to https://simplesamlphp.org/releaseplan (the three "not started" items look like they have completed pull requests). If 1.17 is to be released soon then I don't mind trying to upgrade directly from 1.14.
But if it might take a while for 1.17 to be released then perhaps backporting is a good idea. Either way I can only try to upgrade once it's been released in some version.

@tvdijen

This comment has been minimized.

Member

tvdijen commented Oct 14, 2018

Thanks for getting back to me @RinkAttendant6 !
The release plan is under discussion right now, so I have no definitive answer for now.. My hope is that we can release 1.17 later this month..

@thijskh

This comment has been minimized.

Member

thijskh commented Nov 21, 2018

Fixed in master (1.17)

@thijskh thijskh closed this Nov 21, 2018

@thijskh thijskh added this to the 1.17 milestone Nov 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment