<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 11/07/2016 01:31 PM, Rich Graves
      wrote:<br>
    </div>
    <blockquote
cite="mid:CA+Gkci1-u5A7RiHfDT89JaGf=XmFwckyh84txd=18TP8ygv_Ag@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div dir="ltr">You'll probably have an easier time doing it in
        client-side JavaScript. Any web developer ought to be able to
        help you. Add an "onBlur" function reference to the <span
          style="color:rgb(0,0,0)">j_username element in </span><span
          style="color:rgb(0,0,0)">/opt/shibboleth-idp/views/login.vm.</span>
        <div><span style="color:rgb(0,0,0)"><br>
          </span></div>
        <div><span style="color:rgb(0,0,0)">(And once you've thoroughly
            debugged it, let me know, ok, because this is something I
            could use too.)</span></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <p>We've done JS and server side. I don't think it matters for
      Shibboleth, but we also had issues in the past where the username
      coming out of CAS was cased to how the user typed it. </p>
    <p>        function removeDomainFromUsername() {<br>
                      var usernameField =
      document.getElementById("username");<br>
                      var username = usernameField.value;<br>
                      var handle = username.substring(0,
      username.lastIndexOf("@"));<br>
                      if (handle.length > 0) {<br>
                              usernameField.value = handle;<br>
                      }<br>
              }<br>
      <input autofocus class="form-element form-field" id="username"
      name="j_username" onBlur="removeDomainFromUsername();" type="text"<br>
                             
      value="#if($username)$encoder.encodeForHTML($username)#end"><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p>    <!-- Apply any regular expression replacement pairs before
      validation. --><br>
          <util:list id="shibboleth.authn.Password.Transforms"><br>
              <!-- Get the right username --><br>
              <bean parent="shibboleth.Pair" p:first=<a class="moz-txt-link-rfc2396E" href="mailto:^(.+)@.*$">"^(.+)@.*$"</a>
      p:second="$1" /><br>
          </util:list><br>
    </p>
    <p><br>
    </p>
    <p>We really don't care what domain you put in, we just want it to
      drop it off. Given that about half of the systems require a
      domain, and other other half require that the domain is missing,
      we figured it was good to make these work no matter what your
      muscle memory does.</p>
    <p>Unfortunately, this doesn't handle leading or trailing
      whitespace. Going to have to figure out how and where to take care
      of that. Autocomplete from keyboards can end up putting that in,
      and it is frustrating when that isn't handled.<br>
    </p>
  </body>
</html>