This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| deb13:otp_authenticator_for_php [2026/08/30 23:29] – Bernard Condrau | deb13:otp_authenticator_for_php [2026/08/30 23:47] (current) – Bernard Condrau | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| source / | source / | ||
| - Install pyotp:< | - Install pyotp:< | ||
| - | - Check execution of pyotp:< | ||
| - Create the python script ''/ | - Create the python script ''/ | ||
| import pyotp | import pyotp | ||
| Line 22: | Line 21: | ||
| current_code = totp.now() | current_code = totp.now() | ||
| print(current_code)</ | print(current_code)</ | ||
| + | - Check execution of pyotp:< | ||
| + | - Create a bash script:< | ||
| + | #!/bin/bash | ||
| + | source / | ||
| + | python3 / | ||
| + | deactivate | ||
| + | exit 0</ | ||
| + | - Create a php web page which calls the script:< | ||
| + | <?php | ||
| + | $output = shell_exec('/ | ||
| + | echo $output;</ | ||
| + | - Give the scripts correct ownership and permissions:< | ||
| + | sudo chown www-data: | ||
| + | sudo chmod +x / | ||
| + | - In Synology, you can check the OTP like this:< | ||