I have installed the `laradoo` package in my` Laravel` project, which will connect to odoo DB. I have made the connection to the DB but now I can't authenticate the users from the `res.users model`. because when I tried to fetch user information using the code below.
$ odoo = new \ Edujugon \ Laradoo \ Odoo ();
$ odoo = $ odoo-> connect ();
$ models = $ odoo-> where ('login', 'test@test.com') -> fields ('name', 'login', 'password') -> get ('res.users');
echo "";
print_r ($ models);
it is giving the below response where the password is not returned.
Illuminate \ Support \ Collection Object
(
[items: protected] =>
[id] => 6
[name] => test
[login] => test@test.com
[password] =>
)
)
)
So, I have tried the other way around like create hash on Laravel and try to authenticate like the code below
$ odoo = new \ Edujugon \ Laradoo \ Odoo ();
$ odoo = $ odoo-> connect ();
$ password = "12345";
$ iterations = 1000;
// Generate a random IV using openssl_random_pseudo_bytes ()
// random_bytes () or another suitable source of randomness
$ salt = openssl_random_pseudo_bytes (16);
$ hash = hash_pbkdf2 ("sha512", $ password, $ salt, $ iterations, 20);
$ models = $ odoo-> where ('login', 'test@test.com') -> where ('password', $ hash) -> fields ('name', 'login', 'password') -> get ('res.users');
echo "";
print_r ($ models);
but it is not working properly. it will always return to the user if the password is right or wrong. so, if you could help me in fetching passwords from odoo or creating a hash for odoo `res.users model` would be great.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
3302
Lượt xem
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 12 24
|
2106 | ||
|
4
thg 8 24
|
39241 | ||
|
1
thg 2 22
|
3926 | ||
|
1
thg 2 22
|
6809 | ||
|
0
thg 11 21
|
4351 |