anchor.diff:      }
   
       $( document ).ready(pkceChangeVisibility);
  +    //set form change handler.
       $("form[name='oauthLoginForm']").change(pkceChangeVisibility)
   </script>
   <%
  
positive.code:             }
          }
          var pkceChallenge = document.getElementsByName("code_challenge")[0];
  
          if (pkceMethod == "S256") {
              pkceChallenge.value = "<%=code_challenge%>";
          } else if (pkceMethod == "plain") {
              pkceChallenge.value = "<%=code_verifier%>";
          }
      }
      //function used to hide and show pkce related inputs in the form
      function pkceChangeVisibility() {
          if ($("#grantType").val() == "<%=OAuth2Constants.OAUTH2_GRANT_TYPE_CODE%>" &&
                  $("input[name='use_pkce']:checked")[0].value == "yes") {
              $("#pkceMethod").show();
  
negative.code: 
                  MessageDigest digest = MessageDigest.getInstance("SHA-256");
                  byte[] hash = digest.digest(code_verifier.getBytes(StandardCharsets.US_ASCII));
                  //Base64 encoded string is trimmed to remove trailing CR LF
                  code_challenge = new String(Base64.encodeBase64URLSafe(hash), StandardCharsets.US_ASCII).trim();
                  //set the generated code verifier to the current user session
                  session.setAttribute(OAuth2Constants.OAUTH2_PKCE_CODE_VERIFIER, code_verifier);
  
  