diff --git a/ldap_authentication/LdapAuthenticationConf.class.php b/ldap_authentication/LdapAuthenticationConf.class.php
index b8d5c16..d5075a5 100644
--- a/ldap_authentication/LdapAuthenticationConf.class.php
+++ b/ldap_authentication/LdapAuthenticationConf.class.php
@@ -22,6 +22,7 @@ class LdapAuthenticationConf {
   public $emailOption = LDAP_AUTHENTICATION_EMAIL_FIELD_DEFAULT;
   public $emailUpdate = LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_DEFAULT;
   public $ssoEnabled = FALSE;
+  public $ssoRemoteUserStripDomainName = FALSE;
   public $seamlessLogin = FALSE;
   public $ldapImplementation = FALSE;
   public $cookieExpire = LDAP_AUTHENTICATION_COOKIE_EXPIRE;
@@ -57,6 +58,7 @@ class LdapAuthenticationConf {
     'allowTestPhp',
     'excludeIfNoAuthorizations',
     'ssoEnabled',
+    'ssoRemoteUserStripDomainName',
     'seamlessLogin',
     'ldapImplementation',
     'cookieExpire',
diff --git a/ldap_authentication/LdapAuthenticationConfAdmin.class.php b/ldap_authentication/LdapAuthenticationConfAdmin.class.php
index bde4ee6..00e67dd 100644
--- a/ldap_authentication/LdapAuthenticationConfAdmin.class.php
+++ b/ldap_authentication/LdapAuthenticationConfAdmin.class.php
@@ -111,6 +111,11 @@ class LdapAuthenticationConfAdmin extends LdapAuthenticationConf {
       'for more information.', array('!readme' =>
       l(t('README.txt'), drupal_get_path('module', 'ldap_authentication'). '/README.txt')));
 
+    $values['ssoRemoteUserStripDomainNameDescription'] = t('Useful when the '.
+      'WWW server provides authentication in the form of user@realm and you '.
+      'want to have both SSO and regular forms based authentication '.
+      'available. Otherwise duplicate accounts with conflicting e-mail '.
+      'addresses may be created.');
     $values['seamlessLogInDescription'] = t('This requires that you '.
       'have operational NTLM authentication turned on for at least '.
       'the path user/login/sso, or for the whole domain.');
@@ -173,6 +178,7 @@ class LdapAuthenticationConfAdmin extends LdapAuthenticationConf {
    */
 
   public $ssoEnabledDescription;
+  public $ssoRemoteUserStripDomainNameDescription;
   public $ldapImplementationOptions;
   public $cookieExpirePeriod;
   public $seamlessLogInDescription;
@@ -390,6 +396,13 @@ class LdapAuthenticationConfAdmin extends LdapAuthenticationConf {
       '#default_value' => $this->ssoEnabled,
       );
 
+    $form['sso']['ssoRemoteUserStripDomainName'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Strip REMOTE_USER domain name'),
+      '#description' => t($this->ssoRemoteUserStripDomainNameDescription),
+      '#default_value' => $this->ssoRemoteUserStripDomainName,
+    );
+
     $form['sso']['seamlessLogin'] = array(
       '#type' => 'checkbox',
       '#title' => t('Turn on automated single sign-on'),
@@ -474,6 +487,7 @@ class LdapAuthenticationConfAdmin extends LdapAuthenticationConf {
     $this->emailOption  = ($values['emailOption']) ? (int)$values['emailOption'] : NULL;
     $this->emailUpdate  = ($values['emailUpdate']) ? (int)$values['emailUpdate'] : NULL;
     $this->ssoEnabled = ($values['ssoEnabled']) ? (int)$values['ssoEnabled'] : NULL;
+    $this->ssoRemoteUserStripDomainName = ($values['ssoRemoteUserStripDomainName']) ? (int)$values['ssoRemoteUserStripDomainName'] : NULL;
     $this->seamlessLogin = ($values['seamlessLogin']) ? (int)$values['seamlessLogin'] : NULL;
     $this->cookieExpire = ($values['cookieExpire']) ? (int)$values['cookieExpire'] : NULL;
     $this->ldapImplementation = ($values['ldapImplementation']) ? (string)$values['ldapImplementation'] : NULL;
diff --git a/ldap_authentication/ldap_authentication.inc b/ldap_authentication/ldap_authentication.inc
index 62d06f2..06f2479 100644
--- a/ldap_authentication/ldap_authentication.inc
+++ b/ldap_authentication/ldap_authentication.inc
@@ -494,6 +494,14 @@ function _ldap_authentication_user_login_sso() {
     }
 
     if ($remote_user){
+
+      if ($auth_conf->ssoRemoteUserStripDomainName){
+        $exploded = explode('@', $remote_user);
+        if (count($exploded) == 2){
+          $remote_user = $exploded[0];
+        }
+      }
+
       watchdog('ldap_authentication', '%username : $_SERVER[\'REMOTE_USER\'] found',
               array('%username' => $remote_user), WATCHDOG_DEBUG);
       $fake_form_state = array(
