foxt / icloud.js

Library for accessing iCloud in Node.js

Home Page:https://npmjs.com/icloudjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Status code 400 on set 2fa code

bushaev-denis opened this issue · comments

Hello, this library still WIP?
I always get error when i set security code

const iCloud = require('icloudjs').default
const path = require('path')
const prompt = require('prompt')

const icloud = new iCloud({
    username: "my_apple_id",
    password: "my_password",
    saveCredentials: true,
    trustDevice: true,
    dataDirectory: path.resolve('./tmp/')
});

(async() => {
  await icloud.authenticate()

  if (icloud.status === "MfaRequested") {
    const code =  await prompt.get(['2fa code'])
    await icloud.provideMfaCode(code)
  }

  await icloud.awaitReady;
  console.log("Hello, " + icloud.accountInfo.dsInfo.fullName)
})();
error

Screenshot 2022-11-18 at 01 16 27

PS: also tried enter code without any space

commented

Hello, this library still WIP?

Yes, however authenticaation & read only access to certain services (if you'd like a service prioritised please let me know)

A 400 error code usually indicates that the code was incorrect. I've just published a 1.2.1 version to NPM which should give you more details about why it failed.

Thanks

@foxt

📹 1.2.1
Untitled.mov
PS: Also i tried convert input to number, and got another error Screenshot 2022-11-18 at 09 58 45

Yes, however authenticaation & read only access to certain services (if you'd like a service prioritised please let me know)

Actually i want help you with this library :)
Now i write screensaver for my android tv, and i want write calendar and photos services for your library.

commented

@foxt Yeah, you right. Thanks a lot!

Screenshot 2022-11-18 at 11 34 37