Skip to content

Commit

Permalink
Typo in KeyVaultClient causes invalid authorization request (#74)
Browse files Browse the repository at this point in the history
* Fix invalid resource uri in REST call

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Azure("AuthorizationError(Failed to authenticate to Azure Active Directory
Caused by:
   Generic error: AADSTS70011: The provided request must include a \'scope\' input parameter. The provided value for the input parameter \'scope\' is not valid. 
   The scope https://vault.azure.net.default is not valid

* Be more tolerant w/ setting the endpoint resource url

Co-authored-by: numbers <numbers@dockerhost>
  • Loading branch information
Jeffrey Shen and numbers authored Nov 16, 2020
1 parent 9300b23 commit 93a4b8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdk/key_vault/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ impl<'a, T: TokenCredential> KeyVaultClient<'a, T> {
// Token is valid, return it.
return Ok(());
}
let resource = format!("https://{}", &self.endpoint_suffix);

let mut resource = format!("https://{}", &self.endpoint_suffix);
if !self.endpoint_suffix.ends_with("/") {
resource.push_str("/");
}

let token = self
.token_credential
.get_token(&resource)
Expand Down

0 comments on commit 93a4b8b

Please sign in to comment.