json error: expected value at line 1 column 1
MAC os m3 ,
I used auth application-default login, and Im using the same json ,
but this is failling with json error: expected value at line 1 column 1 no clear of which expected value failed
let config = ClientConfig::default().with_auth().await; match config { Ok(con) => { let client = Client::new(con); info!("successfully connected ") } Err(error) => { error!("something failed {}",error) } }
This doesn't work for me either. I have vanilla JSON, downloaded from GCP, and configured the path with GOOGLE_APPLICATION_CREDENTIALS_JSON env. This error hit me in the face...
Let me add that this works just fine:
let credentials: CredentialsFile = serde_json::from_slice(&fs::read(std::env::var(
"GOOGLE_APPLICATION_CREDENTIALS_JSON",
)?)?)?;
let config = ClientConfig::default()
.with_credentials(credentials)
.await?;
Ehm, I am ashamed but my problem was that I used GOOGLE_APPLICATION_CREDENTIALS_JSON and put there path to the JSON file. Using GOOGLE_APPLICATION_CREDENTIALS works just fine.