pub struct Authenticate {
pub db: String,
pub login: String,
pub password: String,
pub user_agent_env: Map<String, Value>,
}
Expand description
Check the user credentials and return the user ID (web)
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
instead.
§Example
use odoo_api::jmap;
// note that auth fields (db, login, password) are auto-filled
// for you by the client
let resp = client.common_authenticate(
jmap!{
"base_location": "https://demo.odoo.com"
}
).send()?;
println!("UID: {}", resp.uid);
See: odoo/service/common.py
See also: base/models/res_users.py
Fields§
§db: String
The database name
login: String
The username (e.g., email)
password: String
The user password
user_agent_env: Map<String, Value>
A mapping of user agent env entries
Trait Implementations§
Source§impl Debug for Authenticate
impl Debug for Authenticate
Source§impl JsonRpcParams for Authenticate
impl JsonRpcParams for Authenticate
type Container<T> = OdooApiContainer<Authenticate>
type Response = AuthenticateResponse
fn build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Source§impl OdooApiMethod for Authenticate
impl OdooApiMethod for Authenticate
Source§fn describe(&self) -> (&'static str, &'static str)
fn describe(&self) -> (&'static str, &'static str)
Describe the JSON-RPC service and method for this type
Source§fn endpoint(&self) -> &'static str
fn endpoint(&self) -> &'static str
Describe method endpoint (e.g., “/web/session/authenticate”)
Source§fn _build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
fn _build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Build
self
into a full JsonRpcRequest
Auto Trait Implementations§
impl Freeze for Authenticate
impl RefUnwindSafe for Authenticate
impl Send for Authenticate
impl Sync for Authenticate
impl Unpin for Authenticate
impl UnwindSafe for Authenticate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more