Core Boxx – QR Login Module

TABLE OF CONTENTS

 

DOWNLOAD & INSTALLATION

First, the download links for the module, and also “installation instructions”.

 

LICENSE & DOWNLOAD

GitHubSource Forge

Core Boxx is released under the MIT License. You are free to use it for personal and commercial projects, and modify it as you see fit. On the condition that the software is provided “as-is”. There are no warranties provided and “no strings attached”. Code Boxx and the authors are not liable for any claims, damages, or liabilities.

 

 

INSTALLATION

  • Install the Users Module and Admin Module first.
  • Copy/unzip this module into your existing Core Boxx project folder.
  • Access http://your-site.com/install/QRIN, this will automatically:
    • Modify pages/ADM-users.php, load the necessary Javascript.
    • Add “QR Login” button to pages/ADM-users-list.php.
    • Modify pages/PAGE-login.php, load additional Javascript and add “QR login” button.
    • Delete PAGE-install-QRIN.php itself.

 

SORRY FOR THE ADS...

But someone has to pay the bills, and sponsors are paying for it. I insist on not turning Code Boxx into a "paid scripts" business, and I don't "block people with Adblock". Every little bit of support helps.

Buy Me A Coffee Code Boxx eBooks

 

NOTES

  • Register a QR token for the user first. Admin > users > select “QR login”.
  • That’s about it. Print and give the QR token to the user, they can now “scan to login”.

 

FILES LIST

LIBRARIES

  • lib/API-qrin Create and nullify QR token, QR login.
  • lib/LIB-QRIN.php Login with QR library.

ASSETS & PAGES

  • pages/ADM-users-qr.php Additional admin page to manage QR login token for users.
  • assets/PAGE-login-qr.js Login with QR code.
  • assets/PAGE-qrscan.css Additional CSS for login page.
  • assets/html5-qrcode.min.js HTML5 QR Code Scanner.
  • assets/qrcode.min.js JS QR Code Generator.

 

 

LIBRARY REFERENCE

Lastly, the list of library functions and API endpoints.

 

QR LOGIN LIBRARY FUNCTIONS

add ($id)

Create a JWT-encoded login token for the given user.

  • $id INT, user ID.
del ($id)

Nullify the user’s login token.

  • $id INT, User ID.
login ($token)

Login using the given QR token.

  • $token STRING, the JWT token as created by add().

 

QR LOGIN API FUNCTIONS

api/qrin/add

Create a JWT-encoded login token for the given user. Admin only.

  • $_POST["id"] INT, user ID.
api/qrin/del

Nullify the user’s login token. Admin only.

  • $_POST["id"] INT, User ID.
api/qrin/login

Login using the given QR token.

  • $_POST["token"] STRING, the JWT token as created by add().

Leave a Comment

Your email address will not be published. Required fields are marked *