Maxlength attribute in the passwd field of a GlobalProtect Loginpage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

Maxlength attribute in the passwd field of a GlobalProtect Loginpage

L7 Applicator

Hello

As Two-Factor Authentication solution we are using yubico yubikeys (https://www.yubico.com/products/yubikey-hardware/yubikey-2/). These usb-devices generate a token which is 45 characters long. Unfortunately the global protect loginpage limits the maxlength of the password field to 40 characters. As I found out is that this input limitation is only in the html of the GP loginpage. Because if I remove the maxlength attribute, the login works with the yubikey as second factor.

What I tried as a workaround is the following short script in a custom GP loginpage:

<script type="text/javascript">

function setmaxlength () {

  document.getElementsByName("passwd")[0].maxLength = "50";

}

</script>

This script I loaded with additional onload attribute in the BODY tag.

With this script the maxlength will be set to 50 characters but unfortunately then the login does not work because my short javascript seems to break the PaloAlto Javascript which will be added at the beginning of every custom global protect loginpage and so the password field for the second-factor-passwort will never show up.

Does anyone has an idea how to increase this maxlength attribute in the passwd field for the second-factor-password?

Regards,

Remo

1 accepted solution

Accepted Solutions

L5 Sessionator

AXI_IIEN_Remo

Just tested this and it worked fine (with local authentication). Add this in the <head> section of the page:

We will be using Jquery to remove the attribute:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"></script>

<script type="text/javascript">

  $(document).ready(function() {

  $('input[name=passwd]').removeAttr( "maxlength" );

  });

</script>

Hope this helps !

View solution in original post

10 REPLIES 10

L5 Sessionator

Hi AXI_IIEN_Remo

How did you remove the maxlength attribute ? If that works then we can try to remove the attribute using javascript.

L7 Applicator

Hi bat

In Firefox I have an addon called "Web Developper 1.2.5". There I have the option to change html-forms of websites I opened and for example remote maxlength attributes.

As I wrote I tried something with Javascript, but my skilles there are not very good, so at the moment my 2 lines of script break the default javascript which is required by paloalto.

L5 Sessionator

AXI_IIEN_Remo

Could you provide the URL to your global portal page I will try it on my PC

L7 Applicator

Hi bat

My global protect loginpage is the paloalto default at the moment.

But there you could see the issue

L5 Sessionator

Could you try this in the javascript:

document.getElementsByTagName("passwd")[0].removeAttribute("maxLength");

Let me know how it goes.

L7 Applicator

Do you mean to load this by <BODY onload="FUNCTIONNAME()> or in another way?

L5 Sessionator

Yeah I meant that way.

L7 Applicator

Unfortunately this does not work either. The same issue as with my first try to increase the maxlength value by javascript. This short script gets in conflict with the default script which is inserted by paloalto at the beginning of the website (before the <html> tag).

The loginprocess is the following:

1. username and passwort

2. klick on Login

3. new password-box shows up where I have to fill in the second factor from the yubikey

With yours or mine javascript (loaded with body onload) the first step is successfull but the password field for the second factor will never show up.

L5 Sessionator

AXI_IIEN_Remo

Just tested this and it worked fine (with local authentication). Add this in the <head> section of the page:

We will be using Jquery to remove the attribute:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"></script>

<script type="text/javascript">

  $(document).ready(function() {

  $('input[name=passwd]').removeAttr( "maxlength" );

  });

</script>

Hope this helps !

L7 Applicator

Hi bat

Thank you very much for your help. This works perfectly Smiley Happy

  • 1 accepted solution
  • 6468 Views
  • 10 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!