/// Login via LDAP (if configured in Vault)
Login via LDAP (if configured in Vault)
Login via LDAP ( if configured in Vault )
async fn login_ldap(&self, mount_path: &str, username: &str, password: &str)  -> Result<String> {
        let auth_path = format!("auth/{mount}/login/{username}"
            , mount = mount_path.trim_matches('/')
            , username = username );
        let res: Value = self.client.post(auth_path, &json!({ "password": password }))
            .await
            .with_context(|| format!("Could not complete LDAP login request to vault API"))?;
        let token = res["auth"]["client_token"]
            .as_str()
            .ok_or_else(|| anyhow!("Could not find the client token in the LDAP login response"))?;
        Ok(token.to_string())
    }
async fn login_ldap ( & self , mount_path : & str , username : & str , password : & str ) -> Result < String > { let auth_path = format ! ( " " mount mount_path trim_matches ( '/' ) username username ) ; let res : Value = self . client . post ( auth_path , & json ! ( { " " password } ) ) . await . with_context ( | | format ! ( " " ) ) ? ; let token = res [ " " ] [ " " ] . as_str ( ) . ok_or_else ( | | anyhow ! ( " " ) ) ? ; Ok ( token . to_string ( ) ) }
Login via LDAP (if configured in Vault)
Login via LDAP ( if configured in Vault )
&self
mount_path
&str
username
&str
password
&str