Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Commit 24fdabc

Browse files
committed
Change the verbosity level of the "token missing" log messages
1 parent 0b2d47a commit 24fdabc

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/AspNet.Security.OAuth.Introspection/OAuthIntrospectionHandler.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ protected override async Task<AuthenticateResult> HandleAuthenticateAsync() {
4848
// Try to retrieve the access token from the authorization header.
4949
string header = Request.Headers[HeaderNames.Authorization];
5050
if (string.IsNullOrEmpty(header)) {
51-
Logger.LogInformation("Authentication was skipped because no bearer token was received.");
51+
Logger.LogDebug("Authentication was skipped because no bearer token was received.");
5252

5353
return AuthenticateResult.Skip();
5454
}
5555

5656
// Ensure that the authorization header contains the mandatory "Bearer" scheme.
5757
// See https://tools.ietf.org/html/rfc6750#section-2.1
5858
if (!header.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) {
59-
Logger.LogInformation("Authentication was skipped because an incompatible " +
60-
"scheme was used in the 'Authorization' header.");
59+
Logger.LogDebug("Authentication was skipped because an incompatible " +
60+
"scheme was used in the 'Authorization' header.");
6161

6262
return AuthenticateResult.Skip();
6363
}
@@ -66,8 +66,8 @@ protected override async Task<AuthenticateResult> HandleAuthenticateAsync() {
6666
token = header.Substring("Bearer ".Length).Trim();
6767

6868
if (string.IsNullOrEmpty(token)) {
69-
Logger.LogInformation("Authentication was skipped because the bearer token " +
70-
"was missing from the 'Authorization' header.");
69+
Logger.LogDebug("Authentication was skipped because the bearer token " +
70+
"was missing from the 'Authorization' header.");
7171

7272
return AuthenticateResult.Skip();
7373
}

src/AspNet.Security.OAuth.Validation/OAuthValidationHandler.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ protected override async Task<AuthenticateResult> HandleAuthenticateAsync() {
4141
// Try to retrieve the access token from the authorization header.
4242
string header = Request.Headers[HeaderNames.Authorization];
4343
if (string.IsNullOrEmpty(header)) {
44-
Logger.LogInformation("Authentication was skipped because no bearer token was received.");
44+
Logger.LogDebug("Authentication was skipped because no bearer token was received.");
4545

4646
return AuthenticateResult.Skip();
4747
}
4848

4949
// Ensure that the authorization header contains the mandatory "Bearer" scheme.
5050
// See https://tools.ietf.org/html/rfc6750#section-2.1
5151
if (!header.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) {
52-
Logger.LogInformation("Authentication was skipped because an incompatible " +
53-
"scheme was used in the 'Authorization' header.");
52+
Logger.LogDebug("Authentication was skipped because an incompatible " +
53+
"scheme was used in the 'Authorization' header.");
5454

5555
return AuthenticateResult.Skip();
5656
}
@@ -59,8 +59,8 @@ protected override async Task<AuthenticateResult> HandleAuthenticateAsync() {
5959
token = header.Substring("Bearer ".Length).Trim();
6060

6161
if (string.IsNullOrEmpty(token)) {
62-
Logger.LogInformation("Authentication was skipped because the bearer token " +
63-
"was missing from the 'Authorization' header.");
62+
Logger.LogDebug("Authentication was skipped because the bearer token " +
63+
"was missing from the 'Authorization' header.");
6464

6565
return AuthenticateResult.Skip();
6666
}

src/Owin.Security.OAuth.Introspection/OAuthIntrospectionHandler.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ protected override async Task<AuthenticationTicket> AuthenticateCoreAsync() {
4949
// Try to retrieve the access token from the authorization header.
5050
var header = Request.Headers[OAuthIntrospectionConstants.Headers.Authorization];
5151
if (string.IsNullOrEmpty(header)) {
52-
Options.Logger.LogInformation("Authentication was skipped because no bearer token was received.");
52+
Options.Logger.LogDebug("Authentication was skipped because no bearer token was received.");
5353

5454
return null;
5555
}
5656

5757
// Ensure that the authorization header contains the mandatory "Bearer" scheme.
5858
// See https://tools.ietf.org/html/rfc6750#section-2.1
5959
if (!header.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) {
60-
Options.Logger.LogInformation("Authentication was skipped because an incompatible " +
61-
"scheme was used in the 'Authorization' header.");
60+
Options.Logger.LogDebug("Authentication was skipped because an incompatible " +
61+
"scheme was used in the 'Authorization' header.");
6262

6363
return null;
6464
}
@@ -67,8 +67,8 @@ protected override async Task<AuthenticationTicket> AuthenticateCoreAsync() {
6767
token = header.Substring("Bearer ".Length).Trim();
6868

6969
if (string.IsNullOrEmpty(token)) {
70-
Options.Logger.LogInformation("Authentication was skipped because the bearer token " +
71-
"was missing from the 'Authorization' header.");
70+
Options.Logger.LogDebug("Authentication was skipped because the bearer token " +
71+
"was missing from the 'Authorization' header.");
7272

7373
return null;
7474
}

src/Owin.Security.OAuth.Validation/OAuthValidationHandler.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ protected override async Task<AuthenticationTicket> AuthenticateCoreAsync() {
4242
// Try to retrieve the access token from the authorization header.
4343
var header = Request.Headers[OAuthValidationConstants.Headers.Authorization];
4444
if (string.IsNullOrEmpty(header)) {
45-
Options.Logger.LogInformation("Authentication was skipped because no bearer token was received.");
45+
Options.Logger.LogDebug("Authentication was skipped because no bearer token was received.");
4646

4747
return null;
4848
}
4949

5050
// Ensure that the authorization header contains the mandatory "Bearer" scheme.
5151
// See https://tools.ietf.org/html/rfc6750#section-2.1
5252
if (!header.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase)) {
53-
Options.Logger.LogInformation("Authentication was skipped because an incompatible " +
54-
"scheme was used in the 'Authorization' header.");
53+
Options.Logger.LogDebug("Authentication was skipped because an incompatible " +
54+
"scheme was used in the 'Authorization' header.");
5555

5656
return null;
5757
}
@@ -60,8 +60,8 @@ protected override async Task<AuthenticationTicket> AuthenticateCoreAsync() {
6060
token = header.Substring("Bearer ".Length).Trim();
6161

6262
if (string.IsNullOrEmpty(token)) {
63-
Options.Logger.LogInformation("Authentication was skipped because the bearer token " +
64-
"was missing from the 'Authorization' header.");
63+
Options.Logger.LogDebug("Authentication was skipped because the bearer token " +
64+
"was missing from the 'Authorization' header.");
6565

6666
return null;
6767
}

0 commit comments

Comments
 (0)