JEMcats / ubox_camera_api

Take your existing uBox cameras and get infromation from them.
MIT License
1 stars 0 forks source link

[Bug]login failed #3

Open IoT-CI-Ltd opened 4 hours ago

IoT-CI-Ltd commented 4 hours ago

Hi,

First, thanks for your work on this. Annoying that these camera's don't expose readily available stream.

I am however having some issues with this running on Ubuntu.

I have all the .env file all running but keep getting:

Response received: { code: 20005, data: { failed_count: 2, allow_try_count: 30, deny_retry_in_seconds: 0 }, msg: 'Invalid account or password(20005)' } Login failed: Invalid account or password(20005)

I created the account using the Mobile App (iOs).

I had initially configured the camera and account via the i-Cam app, but then deregistered and then configured using the https://apps.apple.com/us/app/ubox/id1436112326

I have also logged in successfully with the creds in the .env file here: https://api-us.ubianet.com/public/login

Have I missed a step somewhere?

Many thanks

JEMcats commented 4 hours ago

Did you create your account using Apple, Google, Etc?

IoT-CI-Ltd commented 4 hours ago

i created the account using the iOs app here: https://apps.apple.com/us/app/ubox/id1436112326 the email account domain is a business one.

IoT-CI-Ltd commented 4 hours ago

also, I cannot see that users.json file is being created as these are the contents of the directory

api_docs LICENSE node_modules package-lock.json server.js CONTRIBUTING.md login.js package.json README.md

JEMcats commented 4 hours ago

If the login fails the users.json will not be created. If you give me a minute I will get back to you with some troubleshooting steps 🙂.

IoT-CI-Ltd commented 4 hours ago

cool, thanks, no rush here really, just let me know if I can help test at all

JEMcats commented 4 hours ago

Do you have access to a code editor?

JEMcats commented 4 hours ago

If you do could you paste this code under line 28

console.log('email',process.env.email)
console.log('password',process.env.password)

after that run login.js again and check that the email and password in the console match what is in the env file.

IoT-CI-Ltd commented 4 hours ago

sorry, which file should I insert under line28?

I can nano files on this machine but very little more at present

JEMcats commented 4 hours ago

login.js

IoT-CI-Ltd commented 4 hours ago

const email = process.env.email; const password = hmacSha1Base64(process.env.password); console.log(password) console.log('email',process.env.email) console.log('password',process.env.password)

so that section should look like this?

JEMcats commented 4 hours ago

Yes

JEMcats commented 4 hours ago

now try running login.js again

IoT-CI-Ltd commented 4 hours ago

yes, those creds returned are correct

JEMcats commented 3 hours ago

can you go to Sha1 Conversion Tool and select these options: Screenshot 2024-10-21 at 5 34 10 PM enter your password and hash it please then check if it matches the string logged by console.log(password)

IoT-CI-Ltd commented 3 hours ago

it is the same apart from the = at the end which is not displayed in the console but displayed when I use the Hashtool

JEMcats commented 3 hours ago

The hash should match the one generated on the webpage but the = is supposed to be replaced with a ,. Are you sure there is nothing?

JEMcats commented 3 hours ago

I have just updated the code, please remove the current directory and follow the setup instructions again. When setting up please change the env file values password and debug_mode to:

password=The Hashed Password with '=' replaced to ','
debug_mode=true
IoT-CI-Ltd commented 2 hours ago

so in password line it should be

password=HASSHEDPASSWORD replaced to ','

?

JEMcats commented 2 hours ago

when you hash you get HASHEDPASSWORD= just change it to HASHEDPASSWORD, and set that in your env file

IoT-CI-Ltd commented 2 hours ago

Response received: { code: 20005, data: { failed_count: 3, allow_try_count: 30, deny_retry_in_seconds: 0 }, msg: 'Invalid account or password(20005)' } Login failed: Invalid account or password(20005)

JEMcats commented 2 hours ago

did you delete the directory and run the git clone command again?

IoT-CI-Ltd commented 2 hours ago

yes

JEMcats commented 2 hours ago

Did you add the

debug_mode=true

to the env file?

IoT-CI-Ltd commented 2 hours ago

yes, one se, just doing all that again to make sure

IoT-CI-Ltd commented 2 hours ago

Yea, jiust redid all of that and it is the same response

i do see this on npm install command

ubox_camera_api$ npm install npm WARN deprecated crypto@1.0.1: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.

?

IoT-CI-Ltd commented 2 hours ago

another thing, when I login here: https://api-us.ubianet.com/public/login all i get is a flash "Success" and then it goes back to the login page. I assume that this is normal?

JEMcats commented 2 hours ago

I never knew about that webpage, but its not the api i used.

JEMcats commented 2 hours ago

Yea, jiust redid all of that and it is the same response

i do see this on npm install command

ubox_camera_api$ npm install npm WARN deprecated crypto@1.0.1: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.

?

You dont need to worry about that, its normal.

IoT-CI-Ltd commented 2 hours ago

THe only other thing I can think of is country selection that would be different, Have I used the right app to create the account?

JEMcats commented 2 hours ago

You have used the correct app, what country do you select when you login?

JEMcats commented 2 hours ago

The only one i have tested is United States

IoT-CI-Ltd commented 2 hours ago

United Kingdom

Let me try with US and see if that does anything

IoT-CI-Ltd commented 2 hours ago

no, don't think country makes a difference