pub async fn authenticate(
client: &Client,
base_url: &str,
username: &str,
password: &str,
) -> Result<String, ClientError>Expand description
Perform SCRAM SHA-256 authentication handshake against a Haystack server.
Executes the three-phase handshake:
- HELLO: sends username, receives SCRAM challenge
- SCRAM: sends client proof, receives auth token and server signature
- Returns the auth token for subsequent Bearer authentication
§Arguments
client- The reqwest HTTP client to usebase_url- The server API root (e.g.http://localhost:8080/api)username- The username to authenticate aspassword- The user’s plaintext password
§Returns
The auth token string on success.