GithubHelp home page GithubHelp logo

Comments (13)

matthewc83 avatar matthewc83 commented on June 23, 2024 1

I'll dig away - I am wondering if it's somehow something to do with infrastructure that is more complex in prod/staging vs local and demo. I am pretty positive it's going to come down to "my" error somewhere - I'll report back if/when I figure it out! Cheers for the input thus far, even knowing it's not something obvious is good to know.

from twofactorauth.

matthewc83 avatar matthewc83 commented on June 23, 2024 1

Hey, just to confirm this does indeed fall under "user error" - no surprises there. A change in our code meant that in actual fact 2 codes were being generated in some environments with the "wrong" one being returned to the user thus never being able to be verified.

Thanks for the suggestions, apologies for the time wasting!

from twofactorauth.

willpower232 avatar willpower232 commented on June 23, 2024

To confirm, you generate a secret successfully, store it in your app of choice but then cannot confirm that the codes that come out of that secret with the same code?

The most basic step is have you verified that the time is correct on all your servers?

from twofactorauth.

matthewc83 avatar matthewc83 commented on June 23, 2024

Hi @willpower232 thanks for the reply.
I generate the code successfully yes, it's the comparison to the users 6 digits that is failing on some servers.
I am thinking down the lines of time thing - though the servers all appear to report the same time, same timezone etc.

from twofactorauth.

willpower232 avatar willpower232 commented on June 23, 2024

I don't think timezone should matter, it would be whether the time down to the seconds is correct.

I'd hope you would get an exception or something if a dependency were missing. I guess you could compare the output of php -i from each server to be sure the environments were appropriately similar.

from twofactorauth.

matthewc83 avatar matthewc83 commented on June 23, 2024

A diff between the outputs of php -i. I don't THINK I see anything obvious:
diff

from twofactorauth.

matthewc83 avatar matthewc83 commented on June 23, 2024

Just thinking, if it was a server time thing - would it be expected that users with existing secrets have no issues? Wouldn't their codes be different from what the server is expecting?

from twofactorauth.

willpower232 avatar willpower232 commented on June 23, 2024

The diff looks fine although they have different image libraries so that might be annoying if you're generating QR codes. Although it could be mcrypt related maybe?

I guess the users devices need to have accurate time as well.

If one users secret works on a server and another users does not then the other users device time must be wrong or they entered the secret incorrectly.

from twofactorauth.

matthewc83 avatar matthewc83 commented on June 23, 2024

Sadly already ruled out the QR code side by using the generated code rather than the QR code.
also ruled out user device based on it being my device working against some environments and not others.
I guess I'll keep at it - probably something stupid that is escaping me.

from twofactorauth.

willpower232 avatar willpower232 commented on June 23, 2024

You can see that in spite of mcrypt, it still uses random_bytes where possible

if (function_exists('random_bytes')) {
return $this->rngprovider = new CSRNGProvider();
}

You could ensure that the function is available on both servers to narrow it down.

from twofactorauth.

matthewc83 avatar matthewc83 commented on June 23, 2024

Yeah, I had put some debugging around that before I started swapping out providers - they were all using CSRNGProvider() by default

from twofactorauth.

willpower232 avatar willpower232 commented on June 23, 2024

Hmm definitely a mystery. I guess you could also verify that the secret being passed to the library was absolutely identical although if it was different then that would be even weirder.

from twofactorauth.

willpower232 avatar willpower232 commented on June 23, 2024

No worries, glad you figured it out! Thanks for letting us know

from twofactorauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.