private void Authenticate(string author, string usedKey) { if (!AuthenticationKeys.CheckKey(usedKey)) { return; } var principal= new MetricsEndpointPrincipal(new GenericIdentity(author),usedKey); Thread.CurrentPrincipal = principal; if(HttpContext.Current!=null) { HttpContext.Current.User = principal; } }
private void Authenticate(string author, string usedKey) { if (!AuthenticationKeys.CheckKey(usedKey)) { return; } var principal = new MetricsEndpointPrincipal(new GenericIdentity(author), usedKey); Thread.CurrentPrincipal = principal; if (HttpContext.Current != null) { HttpContext.Current.User = principal; } }