Core Boxx – NFC 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/NFCIN, this will automatically:
    • Modify pages/ADM-users.php, load the necessary Javascript.
    • Add “NFC Login” button to pages/ADM-users-list.php.
    • Modify pages/PAGE-login.php, load additional Javascript and add “NFC login” button.
    • Delete PAGE-install-NFCIN.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

  • At the time of writing, Web NFC is only supported on Android devices.
  • Register an NFC token for users first. Admin, users, select “NFC login” in the user list.
  • That’s about it. Give the NFC token to the user, they can now “scan to login”.

 

FILES LIST

LIBRARIES

  • lib/API-nfcin Create and nullify NFC token, NFC login.
  • lib/LIB-NFCIN.php Login with NFC library.

ASSETS & PAGES

  • pages/ADM-users-nfc.php Additional admin page to manage NFC login token for users.
  • assets/PAGE-nfc.js Web NFC Javascript.
  • assets/ADM-users-nfc.php Additional JS to manage user NFC tokens.
  • assets/PAGE-login-nfc.php NFC login JS.

 

 

LIBRARY REFERENCE

Lastly, the list of library functions and API endpoints.

 

NFC LOGIN LIBRARY FUNCTIONS

add ($id)

Create a JWT-encoded login token for the given user. Pretty useless in PHP unless you have some ways to save the token into an NFC token.

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

Nullify the user’s login token.

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

Login using the given NFC token.

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

 

NFC LOGIN API FUNCTIONS

api/nfcin/add

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

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

Nullify the user’s login token. Admin only.

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

Login using the given NFC 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 *