The current user is very important if you must run the user through several applications, including some that usually allow anonymous access. In addition, it allows you to explicitly do what is done implicitly in certain types of applications.
From your point of view, it may be more important to understand that not all types of applications automatically receive the type of boot user the way you would like. In these cases, there are several cases where you can programmatically receive an identity and then use it for your own means (unrighteous or otherwise?).
As for impersonating another user, this becomes interesting when you go beyond some declarative situations (for example, impersonating ASP.NET). This is for a good reason, therefore, a hacker does not create an application with God's rights, for example.
source share