Edujugon / laradoo

Odoo ERP API for Laravel
MIT License
160 stars 98 forks source link

How to authenticate users from res.users model #41

Closed divyeshjesadiya closed 1 year ago

divyeshjesadiya commented 3 years ago

After connection, I want to authenticate users from res.users model. I have tried this but not had any success.

`$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');`
yaziderman commented 1 year ago

@divyeshjesadiya Were you trying to implement a single sign on? or other purposes?

divyeshjesadiya commented 1 year ago

@yaziderman At that time I had an understanding of connection and authentication were two different things in the package but after a while, I understood that connection and authentication are the same in the package. So, this is not an issue. we can close this issue.