Skip to content

Embed OTP QR codes in a web page using phpqrcode.

License

Notifications You must be signed in to change notification settings

prgmrcom/otp-phpqrcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

otp-phpqrcode

This library generates an image to embed directly in a web page using phpqrcode. This method avoids:

  • Exposing sensitive data to a third-party web service.
  • Sending the OTP seed as a parameter to another page, potentially recording it to a web server log.
  • Testing a client-side implementation with multiple clients.

Deploying

Edit:

require_once "/usr/share/phpqrcode/phpqrcode.php"

in the source to the actual phpqrcode library path.

Sample usage

<?php
require_once("otp-phpqrcode.php");
inline_otp([
    'id' => "two_factor_qr",
    'username' => $username,
    'secret' =>  $two_factor_key_base32,
    'issuer' => $two_factor_issuer,
]);
?>

About

Embed OTP QR codes in a web page using phpqrcode.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages