privicy / onepassword-web-client

Library to access 1password web vaults.
7 stars 6 forks source link

Does not work if you have 2FA enabled #10

Open aurimasniekis opened 3 years ago

aurimasniekis commented 3 years ago

I have tried to make this work, but there are just more issues than I can understand.

So far I realised that it is missing call to /v1/auth/mfa before getKeySet is called;

I have modified a code a bit to get it working, but the code is not made to expect 2FA. Maybe it is possible to make a callback to ask for 2FA code and then submit it and follow the procedure.

P.S. /v1/auth/mfa request body:

const message = {
            sessionID: this.session.id,
            client: "1Password for Web/945",
            totp: {
                code: mfa,
            }
        };