You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just want to share a little work around to change the source of the creation of the 2-FA QR-Code.
For the creation of the QR-Code teampass sends a request to the site api.qrserver.com (goqr.me).
I had the problem that my teampass server is behind a proxy and the proxy need some authentication.
My server couldnt get the authentication done. So I looked more into this problem.
Teampass uses the library of robthree for creating a qr-code. In this library there are other options to create a qr-code without a request to a website like bacon.
So if your are interested in changing this option here are the steps.
But first my system:
I am using an ubuntu-vm on an Hyper-V, Ubuntu 24.04.2 LTS, Teampass 3.1.4.10, php 8.3.19, maria-db 10.11.11
Do a Backup/Snapshot of your Server
Using compser to get the dependencies in the robthree/twofactorauth library itself
-> path/to/your/teampass/vendor/robthree/twofactorauth
-> execute "composer require bacon/bacon-qr-code"
-> it ist possible that you have to change the rights of the teampassfolder to your current user if its not working proberly
Using composer to link teampass with bacon
-> path/to/your/teampass
-> execute "composer require bacon/bacon-qr-code" again
Now you need to install Imagick
-> If your php-version < 8.3, then you can install it with "sudo apt install php8.x-imagick"
-> If your php-version is >= 8.3 then you need to add another repository.
-> "sudo add-apt-repository ppa:ondrej/php"
-> "sudo apt update"
-> "sudo apt install php8.x-imagick"
Now we have to change two lines of code
-> Go to /path/to/your/teampass/vendor/robthree/twofactorauth/lib and open "TwoFactorAuth.php"
-> First add the line "use RobThree\Auth\Providers\Qr\BaconQrCodeProvider;" under the other use lines.
-> Now after adding the line above change now line 36 from "private ?IQRCodeProvider $qrcodeprovider = null," to "private ?
IQRCodeProvider $qrcodeprovider = new BaconQRCodeProvider(),"
Save the file
Restart your apache and you are done
Now your teampass doesnt need a internet connection to create a qr-code for your 2-fa and creates it locally.
Hopefully this helps one or the other
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I just want to share a little work around to change the source of the creation of the 2-FA QR-Code.
For the creation of the QR-Code teampass sends a request to the site api.qrserver.com (goqr.me).
I had the problem that my teampass server is behind a proxy and the proxy need some authentication.
My server couldnt get the authentication done. So I looked more into this problem.
Teampass uses the library of robthree for creating a qr-code. In this library there are other options to create a qr-code without a request to a website like bacon.
So if your are interested in changing this option here are the steps.
But first my system:
I am using an ubuntu-vm on an Hyper-V, Ubuntu 24.04.2 LTS, Teampass 3.1.4.10, php 8.3.19, maria-db 10.11.11
-> path/to/your/teampass/vendor/robthree/twofactorauth
-> execute "composer require bacon/bacon-qr-code"
-> it ist possible that you have to change the rights of the teampassfolder to your current user if its not working proberly
-> path/to/your/teampass
-> execute "composer require bacon/bacon-qr-code" again
-> If your php-version < 8.3, then you can install it with "sudo apt install php8.x-imagick"
-> If your php-version is >= 8.3 then you need to add another repository.
-> "sudo add-apt-repository ppa:ondrej/php"
-> "sudo apt update"
-> "sudo apt install php8.x-imagick"
-> Go to /path/to/your/teampass/vendor/robthree/twofactorauth/lib and open "TwoFactorAuth.php"
-> First add the line "use RobThree\Auth\Providers\Qr\BaconQrCodeProvider;" under the other use lines.
-> Now after adding the line above change now line 36 from "private ?IQRCodeProvider $qrcodeprovider = null," to "private ?
IQRCodeProvider $qrcodeprovider = new BaconQRCodeProvider(),"
Now your teampass doesnt need a internet connection to create a qr-code for your 2-fa and creates it locally.
Hopefully this helps one or the other
Regards
Sky
Beta Was this translation helpful? Give feedback.
All reactions