This topic is locked

Login with PIN (just 1 field on login screen)

5/15/2022 12:21:33 AM
PHPRunner General questions
dageci authorDevClub member

Hello,
I'm creating an intranet web app (used only inside our organisation).
It is for logging of work done by a user.

We are using barcode scanners and every user is having his own ID that is printed as a barcode on his card.
What I would like to do is to have a login screen with only 1 field (for example password) so that the user can just scan his barcode and this will log him into the webapp.

I can't find a way how to do it, every approach is using username and password. Could I maybe hide the username on login screen and copy the string that is entered whey the kydown or keyup happens?
Any idea or maybe a code how to do this?

Thank you very much for your answers.
Davor

Max 5/16/2022

Hi Davor
why don't you try to:

  1. create users with their own IDs as username, but all with the same password
  2. disable remember password pages and related function
  3. in login page hide password field but fill it with the default password used when you've create the users
  4. using javascript get the carriage return key typed by the barcode scanner to submit the login form

I think it might work.

admin 5/16/2022

Yes, you can probably hide login or username field on the Login and then use BeforeLogin event to perform your own authentication.

If for any reason this approach doesn't work you can also create a totally new page, i.e. an Add page of some table and use it for this purpose. You can perform your authentication in BeforeAdd event of that Add page.

Here is the function you can use to logon the user manually:
loginAs()