Check out example codes for "how to set the current user httpcontext.current.user asp.net -mvc". It will help you in understanding the concepts better.
Code Example 1
String[] newRoles = { "Administrator", "Customer" };
GenericIdentity newIdentity = new GenericIdentity(model.AccountName);
GenericPrincipal newPrincipal = new GenericPrincipal(newIdentity, newRoles);
System.Web.HttpContext.Current.User = newPrincipal;
Learn ReactJs, React Native from akashmittal.com