Example #1
0
 public static string GetClientIpAddress(this HttpRequestMessage request) {
     var context = request?.GetOwinContext();
     return context?.Request.RemoteIpAddress;
 }
Example #2
0
 public static ClaimsPrincipal GetClaimsPrincipal(this HttpRequestMessage message) {
     var context = message?.GetOwinContext();
     return context?.Request?.User?.GetClaimsPrincipal();
 }
Example #3
0
 public static void SetProject(this HttpRequestMessage message, Project project) {
     message?.GetOwinContext().Set("Project", project);
 }
Example #4
0
 public static Project GetProject(this HttpRequestMessage message) {
     return message?.GetOwinContext().Get<Project>("Project");
 }
Example #5
0
 public static void SetUser(this HttpRequestMessage message, User user) {
     message?.GetOwinContext().Set("User", user);
 }
Example #6
0
 public static User GetUser(this HttpRequestMessage message) {
     return message?.GetOwinContext().Get<User>("User");
 }