You are here

saml_sp.api.inc in SAML Service Provider 8.3

API hooks for SAML Service Provider module.

File

saml_sp.api.inc
View source
<?php

/**
 * @file
 * API hooks for SAML Service Provider module.
 */
use OneLogin\Saml2\Settings;

/**
 * Alter the settings used when generating SAML requests.
 *
 * @param \OneLogin\Saml2\Settings $settings
 *   The Settings object.
 */
function hook_saml_sp_settings_alter(Settings &$settings) {

  // Change the consuming URL to a custom endpoint.
  if ($settings->login_url == 'http://example.com/saml/foo') {
    $settings->spReturnUrl = url('saml/custom_action', [
      'absolute' => TRUE,
    ]);
  }
}

Functions

Namesort descending Description
hook_saml_sp_settings_alter Alter the settings used when generating SAML requests.