コード例 #1
0
		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;
			}
		}
コード例 #2
0
        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;
            }
        }