Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

109
Vistas
Duo Authenticator PHP/JS

I'm trying to use the Duo Auth in my application, but after input the passcode or the push notification, nothing happens. I think the Duo would post to the login page or return some response, but i don't know how to automatically post or get the response in the JS.

I'm using the https://github.com/duosecurity/duo_php/tree/master/demos/simple example, the full code can be found in the link.

There are some functions in the JS, including this one, but i can't reach it with the "response" event

function doPostBack(response) {
    // create a hidden input to contain the response token
    var input = document.createElement('input');
    input.type = 'hidden';
    input.name = postArgument;
    input.value = response + ':' + appSig;
    

    // user may supply their own form with additional inputs
    var form = document.getElementById('duo_form');

    // if the form doesn't exist, create one
    if (!form) {
        form = document.createElement('form');

        // insert the new form after the iframe
        iframe.parentElement.insertBefore(form, iframe.nextSibling);
    }

    // make sure we are actually posting to the right place
    form.method = 'POST';
    form.action = postAction;

    // add the response token input to the form
    form.appendChild(input);

    // away we go!
    if (typeof submitCallback === "function") {
        submitCallback.call(null, form);
    } else {
        form.submit();
    }
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda