pub fn authenticate(
db: &str,
login: &str,
password: &str,
user_agent_env: Value
) -> Result<OdooApiRequest<Authenticate>>
Expand description
Check the user credentials and return the user ID (web)
Service: common
Method: authenticate
Request: Authenticate
Response: AuthenticateResponse
This method performs a “login” to the Odoo server, and returns the corresponding
user ID (uid
). It is identical to login
, except that it accepts an extra
param user_agent_env
, which is normally sent by the browser.
This method is inteded for browser-based API implementations. You should use Login
or login
instead.
Example:
use serde_json::{json, Map, Value};
use odoo_api::types::common;
let request = common::authenticate(
"my-database",
"user@example.com",
"password1",
json!({
"base_location": "demo.odoo.com"
})
);
See: odoo/service/common.py
See also: base/models/res_users.py