Questions tagged [claims-based-identity]

Application model for presenting an identity to a claims aware application. This identity contains claim elements, such as email address or username, in a secure package from a trusted source. This model separates the application from the authentication mechanism.

Resources

Wikipedia Entry - Claims-based identity

MSDN Article - Exploring Claims-Based Identity by Kieth Brown

1595 questions
14
votes
4 answers

Best approach for SSO for Asp.Net application with Login from external application with multiple ADFS

I have an already built Asp.Net application which is using Asp.Net membership provider. There is a client web application which has its own login. Once logged in, the user gets some links. These links are directed to the application I have…
14
votes
1 answer

Best practices for creating custom claim types

Given a specific set of permissions, e.g. EditPage, CreateProject, ModifyUser, I am currently looking at two different ways of creating some custom claims types to model this behavior. I can find little information online about the best way to do…
mikesigs
  • 10,491
  • 3
  • 33
  • 40
13
votes
2 answers

How to get Email address from the principal in ASP.net?

I am trying to get the Email associated with the current user. The following shows few lines that I add Claims in authentication. public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context) { …
PCG
  • 2,049
  • 5
  • 24
  • 42
13
votes
2 answers

ASP.NET Core Identity Role, Claim and User

I am an ASP.NET Core beginner. I'm stuck in role, claim and user relationship. I have a user Ben, user belongs to Admin role. Admin role has claims view-page and edit-page in database. But I can't get claims and roles to be belonging to that…
trinvh
  • 1,500
  • 2
  • 11
  • 20
13
votes
1 answer

Claims Auth with OWIN Self Hosted WebApi

I am self hosting WebApi with the following configuration: Visual Studio 2012 / .NET 4.0 public void Configuration(IAppBuilder appBuilder) { var config = new HttpConfiguration(); // authentication config.MessageHandlers.Add(new…
13
votes
3 answers

Map tables using fluent api in asp.net MVC5 EF6?

I am trying to add profile/Membership information into my MVC5 application and adding configuration mappings. I get the following error message: my.Models.IdentityUserLogin: : EntityType 'IdentityUserLogin' has no key defined. Define the key for…
13
votes
2 answers

Why Claim based authentication instead of role based authentication

I am new to claim based authentication. I have gone throught several aricles and could not able to figure out the exact use of claim based authentication. Here are some doubts I have about claim based authentication. I would like to know what is…
12
votes
2 answers

User.Identity fluctuates between ClaimsIdentity and WindowsIdentity

I have an MVC site that allows logging in using both Forms login and Windows Authentication. I use a custom MembershipProvider that authenticated the users against Active Directory, the System.Web.Helpers AntiForgery class for CSRF protection, and…
Guy Passy
  • 694
  • 1
  • 9
  • 32
12
votes
1 answer

Getting the ClaimsPrincipal or ClaimsIdentity from inside ASP.NET Core dependency Injection

I have a class that has ClaimsIdentity as a dependency like so: public ClaimsIdentityDecorator(ClaimsIdentity identity) That is supposed to be the Claimsidentity of the current user. I retrieve it like via the IHttpContextAccessor like…
Justin Dearing
  • 14,270
  • 22
  • 88
  • 161
12
votes
2 answers

Retrieve Userid from a claims in a cookie in Core MVC

I want to store a userId in a cookie, in ASP.NET Core MVC. Where can I access it? Login: var claims = new List { new Claim(ClaimTypes.NameIdentifier, "testUserId") }; var userIdentity = new ClaimsIdentity(claims, "webuser"); var…
12
votes
1 answer

Basic Authentication Middleware with OWIN and ASP.NET WEB API

I created an ASP.NET WEB API 2.2 project. I used the Windows Identity Foundation based template for individual accounts available in visual studio see it here. The web client (written in angularJS) uses OAUTH implementation with web browser cookies…
12
votes
1 answer

The property 'Claims' on type 'AspNetUser' is not a navigation property

I'm using ASP.NET Identity 2.2. I'm migrating the ASP.NET old membership to new Identity system. I am following the steps mentioned in this article for performing the migration. I have extended IdentityUser and added few more properties like…
12
votes
4 answers

Is there any way I can mock a Claims Principal in my ASP.NET MVC web application?

I've got some ASP.NET MVC controller code that checks if a user is authenticated and if so, it checks to see if it has a specific claim. Works fine. I've got some unit tests and I need to mock out an IPrincipal (which is easy to do) ... but I'm not…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
12
votes
5 answers

Exclude specific path from WIF authorization in a ASP.NET MVC 4 project

We have successfully configured windows identity foundation (WIF) in our ASP.NET 4.5 MVC 4 project with the help of the Identity and Access... extension for Visual Studio 2012. But are unable to exclude a specific path from authorization to allow…
thmshd
  • 5,729
  • 3
  • 39
  • 67
12
votes
1 answer

Where is ClaimTypes.IdentityProvider?

Using .Net 4.5 RC and Azure Access Control Service, the primary claims I am interested in are the IdentityProvider and the NameIdentifier. System.Security.Claims.ClaimTypes contains constants for well-known claims, and it has…
Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575