You are here

function hook_saml_sp_settings_alter in SAML Service Provider 4.x

Same name and namespace in other branches
  1. 8.3 saml_sp.api.inc \hook_saml_sp_settings_alter()
  2. 8.2 saml_sp.api.inc \hook_saml_sp_settings_alter()
  3. 7.8 saml_sp.api.inc \hook_saml_sp_settings_alter()
  4. 7 saml_sp.api.inc \hook_saml_sp_settings_alter()
  5. 7.2 saml_sp.api.inc \hook_saml_sp_settings_alter()
  6. 7.3 saml_sp.api.inc \hook_saml_sp_settings_alter()
  7. 3.x saml_sp.api.inc \hook_saml_sp_settings_alter()

Alter the settings used when generating SAML requests.

Parameters

\OneLogin\Saml2\Settings $settings: The Settings object.

1 invocation of hook_saml_sp_settings_alter()
saml_sp__get_settings in ./saml_sp.module
Get the SAML settings for an IdP.

File

./saml_sp.api.inc, line 16
API hooks for SAML Service Provider module.

Code

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,
    ]);
  }
}