Git Product home page Git Product logo

Comments (4)

bdemers avatar bdemers commented on May 29, 2024 1

cc @FeiChen-okta do you have a MFA example handy?

from okta-auth-java.

bdemers avatar bdemers commented on May 29, 2024

Hey @alexzaitsev!

Usually, this means your base URL is incorrect (but was a valid URL), maybe the path in the URL is wrong? If you cannot figure it out, you can share it here (or if you want to keep it private) email Developer support: developers at okta.com, and include a link to this thread.

from okta-auth-java.

alexzaitsev avatar alexzaitsev commented on May 29, 2024

@bdemers thanks, seems that I managed to fix it using your answer. Now I get "MFA_REQUIRED"....
If you have any idea where to dig further - please give me a link / whatever.
I'm closing this issue, thanks a lot!

from okta-auth-java.

FeiChen-okta avatar FeiChen-okta commented on May 29, 2024

@alexzaitsev Yes you can handle the MFA by using the state handler or simply checking the status. A simple example that only handles push/question/totp factors:

public AuthenticationResponse verifyFactor(final AuthenticationResponse response,
                                               final FactorType type,
                                               final String totpOrAnswer)
            throws AuthenticationException {
        String stateToken = response.getStateToken();
        Factor factor = getFactorByType(response.getFactors(), type);
        VerifyFactorRequest request;
        if (type == PUSH) {
            request = authenticationClient.instantiate(VerifyPushFactorRequest.class);
        } else {
            // For TOTP or QUESTION.
            request = authenticationClient.instantiate(VerifyFactorRequest.class);
            request.put(type == TOKEN_SOFTWARE_TOTP ? "passCode" : "answer", totpOrAnswer);
        }
        request.setStateToken(stateToken);
        return authenticationClient.verifyFactor(factor.getId(), request, null);
    }

The method returns a AuthenticatorResponse that should have a SUCCESS status.
If the factor is push then get the factor status and it should be WAITING. which means it is waiting for the user to accept the push notification.

from okta-auth-java.

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.