Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 9b017ae

Browse files
authored
Merge pull request #400 from Sascha-Developer/main
Fill ErrorDescription property in AuthorizeAsync for AuthorizeResult.
2 parents 69b4e93 + ed6e239 commit 9b017ae

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/OidcClient/AuthorizeClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public async Task<AuthorizeResult> AuthorizeAsync(AuthorizeRequest request,
6262
}
6363

6464
result.Error = browserResult.Error ?? browserResult.ResultType.ToString();
65+
result.ErrorDescription = browserResult.ErrorDescription;
6566
return result;
6667
}
6768

test/OidcClient.Tests/AuthorizeRequestTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public async Task Browser_error_is_surfaced_in_authorize_response()
8989
Browser = new TestBrowser(_ => Task.FromResult(new BrowserResult
9090
{
9191
ResultType = BrowserResultType.HttpError,
92-
Error = "Something terrible happened"
92+
Error = "Something terrible happened",
93+
ErrorDescription = "Explaining the terrible error..."
9394
}))
9495
};
9596

@@ -98,6 +99,7 @@ public async Task Browser_error_is_surfaced_in_authorize_response()
9899
var response = await client.AuthorizeAsync(new AuthorizeRequest());
99100

100101
response.Error.Should().Be("Something terrible happened");
102+
response.ErrorDescription.Should().Be("Explaining the terrible error...");
101103
}
102104
}
103105
}

0 commit comments

Comments
 (0)