SimpleSAMLPHP Integration Authentication Source 500 Error

Viewed 41

I am going to apologize outright as this is the first time I have worked with simpleSAML, and I do not understand the nature of my issue and any exception handling has yielded only vague results. I think this is more a SimpleSAML issue than a PHP issue, but I do not know entirely. I have searched all over StackOverflow and searched many different variations but do not see anyone with the same issue as me.

I am setting up one of our sites with SimpleSAMLPHP. I have configured it correctly and when going into the SAML test/demo module I get all the correct information from our SSO Azure configuration. If there is any other

For reference, the relevant part of my authsources.php:

'default-sp' => [
        'saml:SP',
        'privatekey' => 'saml.pem',
        'certificate' => 'saml.crt',

        // The entity ID of this SP.
        // Can be NULL/unset, in which case an entity ID is generated based on the metadata URL.
        'entityID' => null,

        // The entity ID of the IdP this SP should contact.
        // Can be NULL/unset, in which case the user will be shown a list of available IdPs.
        'idp' => '<id_of_idp_listed_in_demo_page>',

        // The URL to the discovery service.
        // Can be NULL/unset, in which case a builtin discovery service will be used.
        'discoURL' => null,

The next step according to SimpleSAML's documentation is to integrate the authentication into my application. (https://simplesamlphp.org/docs/stable/simplesamlphp-sp.html#integrating-authentication-with-your-own-application) For testing purposes, I have a button that leads to a dologinsaml.php page, which looks like this:

<?php
session_start();
require_once ('../../lib/_autoload.php');

$as = new \SimpleSAML\Auth\Simple('default-sp');
echo $as;

$as->requireAuth();
$attributes = $as->getAttributes();
  print_r($attributes);
?>

When I load the page, I am met with a 500 error. I have isolated the issue to the single expression:

new \SimpleSAML\Auth\Simple('default-sp');

Whenever this, or any other call like it:

throw new \SimpleSAML\Error\Exception('Something is wrong...');

is anywhere in the page, it errors out. I cannot get any helpful error message out of it and have no idea what is causing this. I am using PHP 7.3.6. If there is any other detail in the config/authsources that I can provide please let me know.

I just want to understand if this is a misconfiguration on simplesaml or if there is some library I am missing here. I appreciate any guidance.

EDIT: For clarity, I have quadruple-checked that

'../../lib/_autoload.php'

points to the right destination.

0 Answers
Related