10-13-2022 11:58 AM
Hi community! I’m trying to add Duo Authentication to my PHP web app. I have “tried” to follow the documentation for the SDK under PHP, but none of the example/demo files work for me.
Is there any sample code out there that anyone has used that you could recommend? I’m not trying to do anything fancy, just present the authentication screen, and capture a session variable that says you authenticated.
Thanks in advance.
11-15-2022 02:38 AM
Hello, Looking for similar info. Did you get it to work?
11-16-2022 10:35 AM
The demo project in duo_universal_php/example at main · duosecurity/duo_universal_php · GitHub didn’t work for you?
11-16-2022 10:45 PM
Hello
When i copy the example folder to my test xampp server and run index.php i get error that ‘/vendor/autoload.php’ in not found, and there is no such file in this example.
Egert
11-18-2022 06:42 AM
I believe that gets added by composer? Did you run composer to get the demo requirements? I’m sorry to say I am not a PHP person…
11-18-2022 11:51 AM
Php scripts dont need compiling or similar, just php server and they should work.
11-18-2022 01:29 PM
True, that’s just how we made the Duo PHP example app work with our chosen web framework.
The example application provided demonstrates how to use the Duo client from an already-existing web application that already has authentication capabilities. It does not represent an entire authentication module that can simply be dropped in place.
I hope that information helps.
11-20-2022 12:44 AM
So far i havent managed to get this sample code to work unfortunately. Perhaps someone has more basic example, where main auth is hard coded into pre filled variables, and example code does mfa with it?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide