Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

118
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda