// GET: api/Values public IEnumerable <string> GetUserIdentity() { string apikey = ""; if (!string.IsNullOrEmpty(HttpRequestMessageApiKeyExtension.GetApiKey(this.Request))) { apikey = HttpRequestMessageApiKeyExtension.GetApiKey(this.Request).ToString(); } return(new string[] { User.Identity.Name, User.Identity.AuthenticationType, User.Identity.IsAuthenticated.ToString(), User.IsInRole("admin").ToString(), apikey.ToString() }); }
// GET: api/Values public IEnumerable <string> GetUserApiKey() { string apikey = ""; if (!string.IsNullOrEmpty(HttpRequestMessageApiKeyExtension.GetApiKey(this.Request))) { apikey = HttpRequestMessageApiKeyExtension.GetApiKey(this.Request).ToString(); } return(new string[] { "value1", "value2", apikey }); }