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
10
votes
2 answers

Using ClaimsAuthenticationManager in a console application

I was playing around with new stuff in 4.5 and wrote a simple console application that is supposed to check a few things in new claims based security model. I've created custom implementations of ClaimsAuthorizationManager and…
emdzej
  • 165
  • 1
  • 8
9
votes
1 answer

Is claims based authorization appropriate for individual resources

I understand the usage of claims for things I would commonly refer to as "roles" or "permissions". I know that claims are more general, but from what I have seen in practice, it usually boils down to this: If user has this set of claims they can…
BlakeH
  • 3,354
  • 2
  • 21
  • 31
9
votes
5 answers

ASP.NET Claim NameIdentifier Id gets convert error

i have problem with this code: private async Task GenerateJwtToken(string email, User user) { var claims = new List { new Claim(JwtRegisteredClaimNames.Sub, email), new Claim(JwtRegisteredClaimNames.Jti,…
9
votes
3 answers

How to add additional claims in Api Project when using IdentityServer 4

Sorry for my english. I have three projects: IdentityServer, Ensino.Mvc, Ensino.Api. The IdentityServer Project provides the main identity information and claims - claim Profile, claim Address, claim Sid... etc, from the IdentityServer4 library. The…
9
votes
1 answer

asp.net core identity extract and save external login tokens and add claims to local identity

I am a stackoverflow noob so please go easy if I am doing this wrong. I am using asp.net core with the default core identity template (local accounts). I have accertained how to add claims to user principal when they login locally like…
9
votes
3 answers

Add claims with Owin Middleware

Is it possible with an Owin Middleware implementation to add claims prior to the execution of a Web API controller? Created an OwinMiddleware implementation and added an identity: var id = new ClaimsIdentity(); id.AddClaim(new Claim("Whatever",…
9
votes
2 answers

MVC 5 - Add a claim to a user

I am developing a MVC 5 internet application and am using Identity 2.1. How can I add a claim to a user, after the user has logged in, where I knows the username? Here is what I have: public void AddClaimToUser(string userName, string type, string…
Simon
  • 7,991
  • 21
  • 83
  • 163
9
votes
3 answers

Configure ADFS to become a identity provider in Thinktecture IdentityServer 2.0

I am trying setup a sample: a web application uses active directory log-on through thinktecture identity server 2.0. Both Active Directory and Thinktecture IdentityServer are setup on a same machine. I configured Thinktecture IdentityServer to use…
Louis Nguyen
  • 139
  • 1
  • 1
  • 3
8
votes
3 answers

Is it possible to get ACS claims without editing web.config?

Is it possible to set up the realm URL, claim types, etc for azure ACS without editing the web.config? Can you set up these required elements programmatically somehow? EDIT: Specifically I want to get rid of this:
Seth Micalizzi
  • 449
  • 6
  • 17
8
votes
3 answers

Validating JWT getting a strange “ Unable to match key kid” error

I am trying to validate a valid JWT using this code below but am getting a strange error "IDX10501: Signature validation failed. Unable to match key: kid: 'System.String'. Exceptions caught: 'System.Text.StringBuilder'. token:…
CodeMan03
  • 570
  • 3
  • 18
  • 43
8
votes
1 answer

.Net Core Identity Framework Get Users By Claim

In our .NET Core Web API, we have configured claim based authorization and it works perfectly. We have created role-claims and assign roles to users. We do not use user-claims. Now I have a requirement to get users having a specific claim. In…
8
votes
2 answers

Can NameIdentifier and IdentityProvider (WIF) claims be used to uniquely identify any user?

Thinking of using Access Control Service (ACS) and Windows Identity Foundation (WIF) to secure my WCF Data Services Web API application. How can I use claims to uniquely identify a user? My idea is to use the combination of the standard claim…
noopman
  • 660
  • 1
  • 4
  • 15
8
votes
2 answers

Azure Function 2.x - Get Current User's Claims

I have an Azure Function 2.x (Asp.net Core) and am authenticating with Azure AD. I'm trying to access the logged-in user's Claims after authentication. Previously using Azure Functions 1.x we would get the Claims using ClaimsPrincipal.Current, as…
8
votes
1 answer

Users Roles Permissions using ASP.NET Core Identity 3

I'm stuck on a solution that I would like to provide in an asp.net mvc core application. I would like to provide a solution to the standard User, Roles, Permissions in a web application leveraging the new Claims based approach. I've been following…
JReam
  • 898
  • 2
  • 13
  • 28
8
votes
1 answer

How to get current login user's username & email address in C# Azure B2C authentication without Graph API?

How to get current login username and also their email address? Identity provider for the account is username not email. Username is not returned as claims in any of policy such as sign-in, sign-up etc. Custom attribute like "SpouseName" can be…
P. Nabin
  • 173
  • 2
  • 11