You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/identity/azure_identity/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
### Features Added
6
6
7
+
- A `get_token()` error caused by an HTTP response carries that response. See the [troubleshooting guide](https://aka.ms/azsdk/rust/identity/troubleshoot#find-relevant-information-in-errors) for example code showing how to access the response.
Copy file name to clipboardExpand all lines: sdk/identity/azure_identity/TROUBLESHOOTING.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,37 @@ This error contains several pieces of information:
42
42
43
43
-__Correlation ID and Timestamp__: The correlation ID and timestamp identify the request in server-side logs. This information can be useful to support engineers diagnosing unexpected Microsoft Entra ID failures.
44
44
45
+
Many credential errors also carry the HTTP response that caused them. This can help in advanced debugging scenarios, for example when you want to check header values that aren't represented in the error message. The example below demonstrates how to access that response in such a case.
46
+
47
+
```rust
48
+
useazure_core::error::ErrorKind;
49
+
50
+
letresult=client.method().await;
51
+
ifletErr(err) =result {
52
+
matcherr.kind() {
53
+
// ErrorKind::Credential indicates an authentication problem
54
+
ErrorKind::Credential=> {
55
+
// a credential error may wrap another error having an HTTP response
r#"AzurePipelinesCredential authentication failed. 403 response from the OIDC endpoint. Check service connection ID and pipeline configuration. Headers { x-msedge-ref: "foo", x-vss-e2eid: "bar" }
298
+
To troubleshoot, visit https://aka.ms/azsdk/rust/identity/troubleshoot#apc"#,
299
+
err.to_string(),
306
300
);
301
+
match err
302
+
.downcast_ref::<azure_core::Error>()
303
+
.expect("returned error should wrap an azure_core::Error")
0 commit comments