-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add log event name for Identity #16879
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/Identity/ApiAuthorization.IdentityServer/src/LoggerEventIds.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer | ||
{ | ||
internal static class LoggerEventIds | ||
{ | ||
public static readonly EventId ConfiguringAPIResource = new EventId(1, "ConfiguringAPIResource"); | ||
public static readonly EventId ConfiguringLocalAPIResource = new EventId(2, "ConfiguringLocalAPIResource"); | ||
public static readonly EventId ConfiguringClient = new EventId(3, "ConfiguringClient"); | ||
public static readonly EventId AllowedApplicationNotDefienedForIdentityResource = new EventId(4, "AllowedApplicationNotDefienedForIdentityResource"); | ||
public static readonly EventId AllApplicationsAllowedForIdentityResource = new EventId(5, "AllApplicationsAllowedForIdentityResource"); | ||
public static readonly EventId ApplicationsAllowedForIdentityResource = new EventId(6, "ApplicationsAllowedForIdentityResource"); | ||
public static readonly EventId AllowedApplicationNotDefienedForApiResource = new EventId(7, "AllowedApplicationNotDefienedForApiResource"); | ||
public static readonly EventId AllApplicationsAllowedForApiResource = new EventId(8, "AllApplicationsAllowedForApiResource"); | ||
public static readonly EventId ApplicationsAllowedForApiResource = new EventId(9, "ApplicationsAllowedForApiResource"); | ||
public static readonly EventId DevelopmentKeyLoaded = new EventId(10, "DevelopmentKeyLoaded"); | ||
public static readonly EventId CertificateLoadedFromFile = new EventId(11, "CertificateLoadedFromFile"); | ||
public static readonly EventId CertificateLoadedFromStore = new EventId(12, "CertificateLoadedFromStore"); | ||
public static readonly EventId EndingSessionFailed = new EventId(13, "EndingSessionFailed"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Microsoft.AspNetCore.Identity | ||
{ | ||
internal static class EventIds | ||
{ | ||
public static EventId UserCannotSignInWithoutConfirmedEmail = new EventId(0, "UserCannotSignInWithoutConfirmedEmail"); | ||
public static EventId SecurityStampValidationFailed = new EventId(0, "SecurityStampValidationFailed"); | ||
public static EventId SecurityStampValidationFailedId4 = new EventId(4, "SecurityStampValidationFailed"); | ||
public static EventId UserCannotSignInWithoutConfirmedPhoneNumber = new EventId(1, "UserCannotSignInWithoutConfirmedPhoneNumber"); | ||
public static EventId InvalidPassword = new EventId(2, "InvalidPassword"); | ||
public static EventId UserLockedOut = new EventId(3, "UserLockedOut"); | ||
public static EventId UserCannotSignInWithoutConfirmedAccount = new EventId(4, "UserCannotSignInWithoutConfirmedAccount"); | ||
public static EventId TwoFactorSecurityStampValidationFailed = new EventId(5, "TwoFactorSecurityStampValidationFailed"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Microsoft.Extensions.Identity.Core | ||
{ | ||
internal static class LoggerEventIds | ||
{ | ||
public static readonly EventId RoleValidationFailed = new EventId(0, "RoleValidationFailed"); | ||
public static readonly EventId InvalidPassword = new EventId(0, "InvalidPassword"); | ||
public static readonly EventId UserAlreadyHasPassword = new EventId(1, "UserAlreadyHasPassword"); | ||
public static readonly EventId ChangePasswordFailed = new EventId(2, "ChangePasswordFailed"); | ||
public static readonly EventId AddLoginFailed = new EventId(4, "AddLoginFailed"); | ||
public static readonly EventId UserAlreadyInRole = new EventId(5, "UserAlreadyInRole"); | ||
public static readonly EventId UserNotInRole = new EventId(6, "UserNotInRole"); | ||
public static readonly EventId PhoneNumberChanged = new EventId(7, "PhoneNumberChanged"); | ||
public static readonly EventId VerifyUserTokenFailed = new EventId(9, "VerifyUserTokenFailed"); | ||
public static readonly EventId VerifyTwoFactorTokenFailed = new EventId(10, "VerifyTwoFactorTokenFailed"); | ||
public static readonly EventId LockoutFailed = new EventId(11, "LockoutFailed"); | ||
public static readonly EventId UserLockedOut = new EventId(12, "UserLockedOut"); | ||
public static readonly EventId UserValidationFailed = new EventId(13, "UserValidationFailed"); | ||
public static readonly EventId PasswordValidationFailed = new EventId(14, "PasswordValidationFailed"); | ||
public static readonly EventId GetSecurityStampFailed = new EventId(15, "GetSecurityStampFailed"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we have different event ids for the same message, 4 and 5 due to different methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kahbazi I think its fine to introduce the logging extensions to the API which wasn't currently using event ids, but it doesn't look like its worth the potential regression in modifying the event ids for the sign in manager/existing apis. Unless you want to introduce a line by line method, so maybe lets just revert/delete LogginExtensions, but keep the LoggerEventIds changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to be consentience for each log. Should I delete
LogginExtensions
completely and add event id to each logs?Or add another method to
LogginExtensions
for invalid security stamp?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right maybe the safest way to do it is https://github.com/dotnet/aspnetcore/pull/16879/files#diff-7d0bb5dd924f2d3e3de48da228cfbd19 so introduce a new file that's just the ids,, so no LoggingExtensions class like you said