Make the check the same as in simplesamlphp