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.
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
Increase Logging in External Login and return correct result when failing to create user #17068
Increase Logging in External Login and return correct result when failing to create user #17068
Changes from 3 commits
05ff0e1
a31ef89
5927034
6c85e2c
96ea31a
37e7562
0e5e127
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think all of these log messages would be more useful if they were to include the username as well. Otherwise, unless you're testing this right there, you won't know the context.
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.
We can't log private info like username or id. The logs are helpful to understand what is happening during external login.
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.
Why would the username or ID be private info in this context? These logs will be inspected by developers of the platform, who already have access to the source code, and most possibly in some form to the DB as well.
Alone, this log message only communicates that something went wrong with account creation for somebody. This isn't enough information to troubleshoot the issue, unless login is completely broken.
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.
@sebastienros onces said event user is is private info and should not be logged. Here maybe it not an issue to log username since the user does not actually exists in the database.
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.
It's private when talking about disclosure to the public. But when logging, why wouldn't we log to make the log entry more useful? The whole log is private information, to begin with.
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.
Yeah but if a user asks for their data to be removed, its not simply to remove their info from the logs which puts you at the risk of not being complaint.
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 would say it's fine to mask a value. For example with a username, keep the first/last char and output something like
s******s
(with a fixed number of stars)` and an email keeping the domain part. Note that this could be a service later as this needs more design than just through a generic masking service. There are utilities in the dotnet extensions repo for that.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.
@Piedone we can "in another PR" start logging masked private data. That PR will provide the masking service or static extensions for making different things like Id, Username, email... but I need to finish this PR to address immediate problem.
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 wouldn't want to do a masking service here. Good point about the necessity to remove user accounts. However, user IDs don't fall under this and thus can be logged.
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.
Let's move this good convo into a dedicated issue please: #17075