Skip to content

Commit

Permalink
Merge pull request #1494 from DuendeSoftware/anders/1478_ActivityId
Browse files Browse the repository at this point in the history
Include Activity Id in ErrorMessage
  • Loading branch information
brockallen committed Dec 19, 2023
2 parents c035394 + b0aa162 commit 6e4b3b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/IdentityServer/Endpoints/Results/AuthorizeResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ private async Task RedirectToErrorPageAsync(AuthorizeResponse response, HttpCont
{
var errorModel = new ErrorMessage
{
ActivityId = System.Diagnostics.Activity.Current?.Id,
RequestId = context.TraceIdentifier,
Error = response.Error,
ErrorDescription = response.ErrorDescription,
Expand Down
5 changes: 3 additions & 2 deletions src/IdentityServer/Events/Infrastructure/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ protected internal virtual Task PrepareAsync()
public string? Message { get; set; }

/// <summary>
/// Gets or sets the per-request activity identifier.
/// Gets or sets the per-request trace identifier (not the Activity Id)
/// </summary>
/// <value>
/// The activity identifier.
/// The HttpContext.TraceIdentifier.
/// </value>
/// <remarks>Note that this is not the Activity Id despite the name.</remarks>
public string? ActivityId { get; set; }

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions src/IdentityServer/Models/Messages/ErrorMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ public class ErrorMessage
/// </value>
public string? RequestId { get; set; }

/// <summary>
/// The current Activity Id when the error message was captured.
/// </summary>
/// <value>
/// The Activity Identifier
/// </value>
public string? ActivityId { get; set; }

/// <summary>
/// The redirect URI.
/// </summary>
Expand Down

0 comments on commit 6e4b3b6

Please sign in to comment.