Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Authenticate a user from inside the application #9456


User avatar
0
mahendra created

Hello Expert,

Is there a way I can authenticate a user from inside the application. I have userId and password in plain text. I am trying to create a lock screen.I know you have provided this functionality in version 8.2. But we are on 8.0 and currently its not possible for us to upgrade it to 8.2 or on latest.

I just want to autheticate a user. Don't want to create a new session.

Please advise..

Regards, Mahendra


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    Using plain text password is not a good practice.

    I am trying to create a lock screen

    Can you explain your use case in detail?

  • User Avatar
    0
    mahendra created

    Hi,

    I think I was not able to make you understand about plain text password. Let me try to explain the use case.

    We are creating a retail application that have a component called Web Point of Sales (Web POS). Let’s say a user only has the rights on POS component. So when he logs into the system and he straight away lands on the POS screen. He continues doing sale. Now for some time he needs to leave his computer etc. and he wanted to just lock his screen (of course he can lock the complete computer itself). When he comes back he presses a button called unlock. Here the system would ask him to enter password and if the password is valid/matches, he should be able to unlock the screen and lands up on POS screen.

    Please advise how can we achieve the matching of credential.

    Regards, Mahendra

  • User Avatar
    0
    musa.demir created

    Hi @mahendra You can check that pr https://github.com/aspnetzero/aspnet-zero-core/pull/2932/files and implement differences. To logout manually you can call redirectToLockScreen function https://github.com/aspnetzero/aspnet-zero-core/pull/2932/files#diff-65c4585afefac72102bcf26919b38bf6R58

  • User Avatar
    0
    mahendra created

    Hi,

    I merged the PR as asked by you. The lock screen is getting displayed on session timeout.

    But when I enter the password in the lock screen, it lands me to my default page and NOT on the page where I was. Is this the default behavior? IF yes, how can I land up on the page where I was prior to my lock screen.

    Regards, Mahendra

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mahendra

    You can store the last visited page in cookie or local storage and redirect user to that page when passord is validated on lock screen. If you can create an issue on GitHub, we can also check this and implement.