You are here

function saml_sp_start in SAML Service Provider 7

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

Start a SAML authentication request.

Parameters

Object $idp:

String $callback: A function to call with the results of the SAML authentication process.

1 call to saml_sp_start()
saml_sp_drupal_login__start in modules/saml_sp_drupal_login/saml_sp_drupal_login.module
Start the SAML authentication process.

File

./saml_sp.module, line 275
SAML Service Provider

Code

function saml_sp_start($idp, $callback) {

  // Settings is a OneLogin_Saml_Settings object.
  $settings = saml_sp__get_settings($idp);
  $authRequest = new OneLogin_Saml_AuthRequest($settings);
  $url = $authRequest
    ->getRedirectUrl();

  // Track the ID of the outbound request.
  $prefix_length = strlen($settings->idpSingleSignOnUrl . "?SAMLRequest=");
  $id = _saml_sp__extract_outbound_id(substr($url, $prefix_length));
  saml_sp__track_request($id, $idp, $callback);

  // Redirect the user to the IDP.
  header("Location: {$url}");
}