cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rodddo
Level 3

Password Entry in Custom Console

Hi,

I am attempting to write a custom console action that allows the user to enter a password, then enter a password confirmation. So I have validation to repeat the process until the passwords are the same and conform to the password rules.

This works fine except the passwords are not disguised when entered. Is there a way I can do this through custom console code or do I have to use the Get Password action. In that case how would I get to my validation and force a repeat of the action.

Any help appreciated

thanks

Rod
Labels (1)
0 Kudos
(5) Replies
pv7721
Level 20

AFAIK this password issue was some very old issue about Java behaviour on different platforms when it comes to hide the password characters.
0 Kudos
jerome_IA
Level 9

In consoleUtils, use promptAndGetValueWithEchoCharacter to get your password echoed with the character of your choice:

e.g. ...promptAndGetValueWithEchoCharacter("Enter the password", '*')...
0 Kudos
rodddo
Level 3

that worked great

thanks
0 Kudos
Not applicable

Hi,
promptAndGetValueWithEchoCharacter("Enter the password", '*').. is buggy dont use it. List of bugs i found

1. first it will add one extra * by default and
2. if you type a little fast it shows the original chars
3. if you by any chance type back on password console .. u r in problem. After this whatever u type will be echoed using ur echo char. You will have to abort installation.

i will suggest you u use password class provided in java 1.6. The only problem is it doesn't echo's chars back. For me its acceptable as we run this in unix env. which is default behavior of all shells.
0 Kudos
sturge
Level 6

Yes, I definately get the problem listed at #2 with the Get Password Console panel.
0 Kudos