How to disable the suggestion of passwords saved in the browser via HTML [duplicated]

2

I have the following situation here:

I've created an HTML form to change the user's password if he forgets it.

Theproblemisthatwhentryingtoenterthepasswordthebrowserexposestheoptionsofpasswordsalreadysaved,howeverasthisisnotaloginscreenitisnotinterestingthatthisisdisplayedtotheuser.

TheHTMLcodeI'musingisasfollows:

<formid="form" action="@Url.Action("ResetPassword", "Login")" method="post">
        <div id="enter-options-box">
            <p class="title-bold">@ViewBag.UserId - @ViewBag.Identifier</p>
        </div>

        <label class="form-input">
            <i class="material-icons"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></i>
            <input class="password-mask"
                   type="password"
                   autocomplete="off"
                   id="NewPassword"
                   maxlength="16"
                   name="NewPassword"
                   required
                   onchange="VerifyInput('NewPassword', 'newPassword-text'); this.setCustomValidity('');"
                   oninvalid="this.setCustomValidity('Por favor, preencha este campo.')"
                   onkeyup="CalculeStrength('NewPassword', 'strengt-bar', 'strengt-label')"
                   title=" " />
            <span id="newPassword-text" class="label">Nova senha</span>
            <span class="underline"></span>
        </label>

        <div class="box-bar">
            <div class="progress slin-bar">
                <div id="strengt-bar" class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
            </div>
            <span id="strengt-label">Força da senha.</span>
        </div>

        <label class="form-input">
            <i class="material-icons"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></i>
            <input class="password-mask"
                   type="password"
                   autocomplete="off"
                   id="ConfirmPassword"
                   maxlength="16"
                   name="ConfirmPassword"
                   required
                   onchange="VerifyInput('ConfirmPassword', 'confirmPassword-text'); this.setCustomValidity('');"
                   oninvalid="this.setCustomValidity('Por favor, preencha este campo.')"
                   title=" " />
            <span id="confirmPassword-text" class="label">Confirmar senha</span>
            <span class="underline"></span>
        </label>

        <div class="submit-container clearfix">
            <input id="submit" name="submit" role="button" type="submit" class="btn btn-irenic float-right" tabindex="0" value="SALVAR" onclick="ClickWait('form');" />
        </div>
    </form>

How can I prevent this list of saved passwords from appearing?

Why does the browser interpret this as a login screen?

    
asked by anonymous 04.04.2018 / 00:46

1 answer

2

This is a native browser feature and there is no way to disable it via code.

See what the MDN documentation says:

  

The autocomplete attribute and login fields

     

Modern browsers implement integrated password management:   when the user fills a user and password for a site, the browser   offers to remember the data for the user. When the user   visit the site again, the browser fills in the login fields   automatically according to the values saved by it.

     

Browsers also allow the user to select a master password   so that the saved data is encrypted.

     

Even without a master password, password management within the   browser is generally viewed as a security gain. Like the   users do not need to remember the passwords that the browser saves to   they can choose stronger passwords than usually   would choose.

     

For this reason, many modern browsers do not support    autocomplete="off" for login fields.

     
  • If a site uses autocomplete="off" to form , and the form includes user fields and password, then the browser still   so it offers to save the login data, and if the user   accept, the browser will automatically fill this data in the   next time the user visits the page.

  •   
  • If a site uses autocomplete="off" for input de usuário e senha fields, then the browser still offers to save   the login data, and if the user accepts, the browser will fill in   these data automatically the next time the user visits the   page.

  •   

This behavior exists in Firefox (since version 38), Google   Chrome (since version 34), and Internet Explorer (since version 11).

In conclusion, one of the ways is to delete the passwords stored in Firefox (for example) is to right-click on the page and choose from the menu "View page information":

Inthe"Security" tab, click "View saved passwords":

Thenclickon"Remove All":

    
04.04.2018 / 01:49