Change the auth challenge 401 to be verbose trace. (#2021)
This commit is contained in:
@@ -351,6 +351,18 @@ namespace GitHub.Services.Common.Diagnostics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NonEvent]
|
||||||
|
public void AuthenticationFailedOnFirstRequest(
|
||||||
|
VssTraceActivity activity,
|
||||||
|
HttpResponseMessage response)
|
||||||
|
{
|
||||||
|
if (IsEnabled())
|
||||||
|
{
|
||||||
|
SetActivityId(activity);
|
||||||
|
WriteMessageEvent((Int32)response.StatusCode, response.Headers.ToString(), this.AuthenticationFailedOnFirstRequest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[NonEvent]
|
[NonEvent]
|
||||||
public void IssuedTokenProviderCreated(
|
public void IssuedTokenProviderCreated(
|
||||||
VssTraceActivity activity,
|
VssTraceActivity activity,
|
||||||
@@ -451,7 +463,7 @@ namespace GitHub.Services.Common.Diagnostics
|
|||||||
[NonEvent]
|
[NonEvent]
|
||||||
public void IssuedTokenInvalidated(
|
public void IssuedTokenInvalidated(
|
||||||
VssTraceActivity activity,
|
VssTraceActivity activity,
|
||||||
IssuedTokenProvider provider,
|
IssuedTokenProvider provider,
|
||||||
IssuedToken token)
|
IssuedToken token)
|
||||||
{
|
{
|
||||||
if (IsEnabled())
|
if (IsEnabled())
|
||||||
@@ -813,7 +825,7 @@ namespace GitHub.Services.Common.Diagnostics
|
|||||||
[Event(31, Keywords = Keywords.Authentication, Level = EventLevel.Warning, Task = Tasks.Authentication, Opcode = EventOpcode.Info, Message = "Retrieving an AAD auth token took a long time ({0} seconds)")]
|
[Event(31, Keywords = Keywords.Authentication, Level = EventLevel.Warning, Task = Tasks.Authentication, Opcode = EventOpcode.Info, Message = "Retrieving an AAD auth token took a long time ({0} seconds)")]
|
||||||
public void AuthorizationDelayed(string timespan)
|
public void AuthorizationDelayed(string timespan)
|
||||||
{
|
{
|
||||||
if(IsEnabled(EventLevel.Warning, Keywords.Authentication))
|
if (IsEnabled(EventLevel.Warning, Keywords.Authentication))
|
||||||
{
|
{
|
||||||
WriteEvent(31, timespan);
|
WriteEvent(31, timespan);
|
||||||
}
|
}
|
||||||
@@ -828,6 +840,17 @@ namespace GitHub.Services.Common.Diagnostics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Event(33, Keywords = Keywords.Authentication, Level = EventLevel.Verbose, Task = Tasks.HttpRequest, Message = "Authentication failed on first request with status code {0}.%n{1}")]
|
||||||
|
private void AuthenticationFailedOnFirstRequest(
|
||||||
|
Int32 statusCode,
|
||||||
|
String headers)
|
||||||
|
{
|
||||||
|
if (IsEnabled(EventLevel.Verbose, Keywords.Authentication))
|
||||||
|
{
|
||||||
|
WriteEvent(33, statusCode, headers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the activity ID of the current thread.
|
/// Sets the activity ID of the current thread.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -251,7 +251,14 @@ namespace GitHub.Services.Common
|
|||||||
|
|
||||||
// Invalidate the token and ensure that we have the correct token provider for the challenge
|
// Invalidate the token and ensure that we have the correct token provider for the challenge
|
||||||
// which we just received
|
// which we just received
|
||||||
VssHttpEventSource.Log.AuthenticationFailed(traceActivity, response);
|
if (retries < m_maxAuthRetries)
|
||||||
|
{
|
||||||
|
VssHttpEventSource.Log.AuthenticationFailed(traceActivity, response);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VssHttpEventSource.Log.AuthenticationFailedOnFirstRequest(traceActivity, response);
|
||||||
|
}
|
||||||
|
|
||||||
if (provider != null)
|
if (provider != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user