You are here

function saml_login in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7

Initiate SAML Login.

1 string reference to 'saml_login'
miniorange_saml_menu in ./miniorange_saml.module

File

./miniorange_saml.module, line 303
Module file for miniOrange SAML Module.

Code

function saml_login() {
  $b_url = Utilities::miniorange_get_baseURL();
  $issuer_id = Utilities::miniorange_get_issuer();
  $saml_login_enabled = variable_get('miniorange_saml_enable_login', FALSE);
  if ($saml_login_enabled) {
    $acs_url = $b_url . '/?q=samlassertion';
    $sso_url = variable_get('miniorange_saml_idp_login_url', '');
    $authn_request = new MiniOrangeAuthnRequest();
    $authn_request
      ->initiateLogin($acs_url, $sso_url, $issuer_id);
  }
  else {
    drupal_set_message('Please enable <b>Login with SAML</b> to initiate the SSO.', 'error');
    drupal_goto($b_url);
  }
}