Questions tagged [iprincipal]

The System.Security.Principal.IPrincipal interface defines the basic functionality of a security object. It is most commonly used by applications written for the Microsoft.NET framework.

The System.Security.Principal.IPrincipal interface defines the basic functionality of a security object. This object represents the security context of the user on whose behalf the code is running, including that user's identity (IIdentity) and any roles to which they belong.

129 questions
0
votes
1 answer

Where should I be retrieving the user principal in an ASP.NET Web Forms app?

Assuming a fairly general use case in an ASP.NET Web Forms application, where should I be retrieving my principal + identity? I'm aware that there are generally two ways to go about it: HttpContext.Current.User Thread.CurrentPrincipal I'm…
Richard Neil Ilagan
  • 14,627
  • 5
  • 48
  • 66
0
votes
1 answer

Where to keep data about an authenticated user?

I am still pretty new to ASP.NET Web API. I am currently working on the authentication part of a new application based on Web API, which is developed using some libraries/kinda framework of the company. There is already some MVC application - they…
bandreas
  • 869
  • 1
  • 8
  • 25
0
votes
1 answer

I need code revision if I am authenticating user right - Custom Principal

In my login method I used this code to login user: FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); Since I wanted to avoid database call always when I need UserId and some other data I made something and I am not very sure that…
1110
  • 7,829
  • 55
  • 176
  • 334
0
votes
1 answer

Invalid cast when getting custom IPrincipal from HttpContext

After researching FormsAuthentication for a few days, I decided to store a serialized object in the FormsAuth cookie's UserData property and use a custom IPrincipal object for the HttpContext.Current.User. Most of the guides I've found say to cast…
Lifes
  • 1,226
  • 2
  • 25
  • 45
0
votes
2 answers

Extending Azure ACS Claims for MVC Sessions

I am developing an MVC 4 Application to be hosted in Azure and want to use their ACS service for authentication. Once the user is authenticated I will use the resulting claim details to correlate to my local records. Subsequent to that, I would like…
JoeGeeky
  • 3,746
  • 6
  • 36
  • 53
0
votes
1 answer

MVC's ActionExecutingContext HttpContext.User.Identity.IsAuthenticated Returns False When Signing in on Multiple Browser Tabs

During a custom ActionFilterAttribute's OnActionExecuting method, we ensure that the user is still logged in before performing some actions. We do this by doing something similar to this pseudo code: public override void OnActionExecuting(…
Terry
  • 2,148
  • 2
  • 32
  • 53
0
votes
2 answers

Role-based Security without Forms Authentication in ASP .NET

I would like to take advantage of: Page.User.IsInRole("CustomRole"); Page.User.Identity.IsAuthenticated when working inside Page methods, as well as authorization section in web.config:
dragonfly
  • 17,407
  • 30
  • 110
  • 219
0
votes
1 answer

Problems implementing IPrincipal

Trying to implement IPrincipal (ASP.NET MVC 3) and having problems: my custom IPrincipal: interface IDealsPrincipal: IPrincipal { int UserId { get; set; } string Firstname { get; set; } string Lastname { get; set; } …
Savvas Sopiadis
  • 8,213
  • 10
  • 34
  • 53
-1
votes
1 answer

Why to create a custom principal interface when you want to create a Custom Principal in Asp.net MVC?

Recently I seaerched for how to create custom principal and I got the answer but there is one thing that I do not understand, I found this solution on stack overflow using System; using System.Collections.Generic; using System.Linq; using…
Mo Haidar
  • 3,748
  • 6
  • 37
  • 76
1 2 3
8
9