QRCodeAuthenticator
An authentication app using QR Codes.
We're all familiar with logging in using QR Codes in various apps, it's simple, effective and secure. And also really interesting. So out of curiousity I decided to make my own authentication app using QR Codes.
First of all we need to create a user, on the /register page.
As you see at the response a jwt token for the user was created, and user info is saved into the database.
Great! Now moving on to the login page, using the previous infos we generate a login token (as seen bellow)
So now we created a user and logged in to that user account, and here comes the cool part. In order for us to generate a QR Code, we need the user ID (the index to that user in the database) and the login token we received when we logged in.
The QR Code is returned as a base64 string, and the infos related to it are stored in the database:
After decoding the base64 string the QR Code image is shown:
Then we scan it..
Now, to login using the QR Code we'll be needing the token encrypted in the image, and the device information.
The device infos are stored in the database:
And the token returned will be used to login!
Thank you for checking out my project! If you have any feedback, feel free.