Questions tagged [claims]

Claims were introduced in .NET4.5 to build Claims based authentication into the framework in the form of ClaimsIdentity and ClaimsPrincipal in the System.Security.Claims namespace.

Filter by
Sorted by
Tagged with
0votes
1answer
21views

JWT token role claim translated wrong by DOTNET

I have a Dotnet core 6 Web Api that is receiving requests with JWT Tokens containing, among others, a role claim in the payload, like this: { "role": "SOME_ROLE" } Now, I was ...
user avatar
0votes
0answers
9views

How to retrieve AD Groups as claim-roles in a ClaimsPrincipal object using IdentityServer

Is there a way of retrieving AD Groups of the logged on user when authenticating via IdentityServer 3 and add custom claim based on a certain AD Group? I think I need a HttpClient that does a request ...
user avatar
0votes
1answer
29views

what happens if saml is missing one of default claims in saml & attributes

In azure portal what happens if one of the default saml claims are missing like surname or given name or mail while integrating an app in Azure portal?
user avatar
0votes
0answers
11views

ADFS claims come from nowhere in AccountController.Callback method

Basing on IdS4 samples I am reading external identity from temporary cookie when using external IdentityServer instance to obtain a token and then issue my own token. The external token contains email ...
user avatar
  • 15.9k
0votes
0answers
30views

Search user in local db and add claim to user identity

I have an internally used Blazor webpage and want to use my Azure AD to authenticate against. After the user is logged in I want to search their name/ID/Something from AzureID in my onsite database ...
user avatar
0votes
1answer
50views

Add custom claim for token generation - Duende identity server

I am trying to configure my Duende (former known as identity server4) identity server for authentication and authorisation. For the authentication part, I am using an external authentication service ...
user avatar
0votes
0answers
39views

Claims lost after a period of inactivity

I am integrating the asp.net webforms project with single sign on(SSO) using Openidconnect and Cookie Authentication using Owin libraries. Once authenticated, the cookie should be active for the day ...
user avatar
  • 597
0votes
1answer
60views

ASP.NET - Problem with authentication: Manually added claim is missing in the next request

I am currently experimenting with external login providers like Google Authentication in my ASP.NET application. As you can see on my Program.cs i'am running .NET6. After the Google-Login was ...
user avatar
  • 3
1vote
1answer
62views

How can I make SignInAsync working right here?

Can someone tell me how to fix that error? HttpContext does not contain a definition of SignInAsync. In another project I made with tutorial it works right. Using package: Microsoft.AspNetCore.Http; ...
user avatar
  • 11
1vote
1answer
19views

Change claims value while keeping user logged in c# web api and jquery client

I have a web application which has different shift types that are accessed either by set users in the database for each shift. Or you can log in as a basic requester with your active directory account....
user avatar
2votes
2answers
158views

How to handle array claim values in ASP.net Core using OIDC

Im running Skorubas implementation of IdentityServer4 https://github.com/skoruba/IdentityServer4.Admin For some reason I end up receiving a single role-claim with the claim-type "role" and a ...
user avatar
  • 1,665
0votes
0answers
21views

How to map additional claims in IdentityServer 4 and MVC .Net 461 framework

We've been using Idsrv4 for about 2 years and we have successfully integrated with .Net Core Apis, .Net Core Apps. Now, we've got a legacy app which is costly to migrate to .Net Core from Net461. I'm ...
user avatar
  • 8,075
0votes
0answers
18views

Custom user claims are destroyed even when user is still logged in

I have this definition in Startup.Auth.cs file: app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes....
user avatar
  • 3,125
0votes
1answer
42views

Azure API Management - Customize Token

When calling the token endpoint to get an Azure API access token, I want to pass in extra information to be included in the token. Is that possible? For example, I want to pass in a locationID to the ...
user avatar
  • 1
0votes
1answer
19views

.NET Core claims unavailable when referred from other site

I noticed the original problem when trying to integrate stripe payment to the system. The user is logged in and after filling up necessary details is sent to stripe page to complete the payment. After ...
user avatar
0votes
1answer
142views

ABP Add User's Custom Property from AppUser to Claims

I'm trying to add a claim "business_id" where the value will be taken from AppUser's custom property of "BusinessId". Only resource that I'm able to find relating to this topic, ...
user avatar
  • 378
0votes
2answers
39views

ADFS 3rd Party Claim Provider Trusts - Disable/Expired Local AD Accounts

We have a federation between with our ADFS and the other company Azure AD using the "Claim Provider Trusts". We use the Azure AD to perform the authentication, but our ADFS/AD is sending ...
user avatar
1vote
1answer
411views

How can I retrieve my Custom User Attributes (Claims) from B2C using Graph API?

I have successfully created an application that uses a new B2C Tenant for authentication and I can login and call APIs. I have added new Attributes for the Users (Roles one of them). In my "User ...
user avatar
  • 13
-1votes
1answer
22views

count number of points in table A that exist in a square area in table B - SQL + QGIS

I have a table A that has scattered points existing in space. Table B has a number of squared perimeters. I want an SQL code that will write a table of the number of points in table A that fall in the ...
user avatar
0votes
1answer
125views

nameidentifier claim is required for external login to succeed. How to remove duplicate keys in token

I've finally managed to setup a project using IdentityServer4 to allow users to sign in with a single account into multiple apps. However, I feel like it's not completely as it should be. This is my ...
user avatar
  • 1,587
0votes
0answers
47views

AddPolicy and Requireclaim are not working the way I expect in .net core 6.0

I am using ADB2C and I have a custom claim i added, extension_EnrollasaClinic. When I retrieve the list of claims, I see it in there when it should be in there (I only care about presence, not value) ...
user avatar
  • 197
0votes
0answers
33views

Azure b2c block sign in on sign up

Is it possible to have a user profile have "block sign in" set to true on account sign up? The goal that I'm going for is to essentially have an account need to be approved before they can ...
user avatar
  • 479
0votes
0answers
46views

Does HttpContext.User.GetUserId always return an int using .Net Core?

Will 'GetUserId()' always return an int? My users can't get to this controller method anonymously, they have to be logged in and have a claims principal. var id = HttpContext.User.GetUserId(); public ...
user avatar
  • 11.9k
0votes
1answer
73views

TransformAsync not called in Blazor application

I have a Blazor server app (.NET 5) which authenticated against Firebase. I'm trying to add a claim to the principal once authenticated but the TransformAsync is never called...Any idea what might be ...
user avatar
  • 4,199
0votes
1answer
337views

Blazor server authentication

i want add authentication to my blazor server side application. I have this code to login. var claims = new List<Claim> { new Claim(type: ClaimTypes.NameIdentifier, user.Username), new ...
user avatar
0votes
1answer
83views

I need all users details from ADFS using c# in single outgoing claim

hi I created the custom claim for that so please check the below claim which is created by me: c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer ...
user avatar
  • 19
0votes
0answers
155views

.NET Core Windows Authentication via Client Certificates Mapped to Active Directory

I am trying to set up authentication for a .NET Core 3.1 application. The app needs to authenticate using client certificates mapped to an active directory account. This is done via enabling Windows ...
user avatar
0votes
0answers
163views

Postman + NTLM Authentication + Authorization with claims + ASP.NET Core API = 403 Forbidden

We have an ASP.NET Core API that uses Windows Authentication and Claim based identity. The API has one Controller with multiple Actions. The Actions have different authorization policies. [Authorize(...
user avatar
  • 557
2votes
0answers
52views

Bundling healthcare claims using SAS/SQL

Observations from "other_claims" data set are to summed with the observations in the "event_claims" data set under the following conditions: "Other_claims" occur within ...
user avatar
  • 63
0votes
1answer
50views

healthcare enrollment verification of claims

All: I'm trying to verify if a hospital stay should be covered based on enrollment data using SAS. There are two tables: "enr" : 2 years of a binary (0/1) if the patient was enrolled on ...
user avatar
  • 63
0votes
0answers
76views

ClaimsPrincipal not working on IIS - Object reference not set to an instance of an object

Why does this code work locally when I run the program in Visual Studio (IIS Express) but not on IIS? Error: Object reference not set to an instance of an object var userName = claim.Subject.Name ...
user avatar
  • 119
0votes
0answers
63views

ASP.NET Core claims

I create project with two methods - cookies one for "admin" and for "normal" user. public void ConfigureServices(IServiceCollection services) { services....
user avatar
0votes
1answer
70views

Azure Active Directory API - EC001 Claims Missing

I have to call an API hosted (not by me) on an app on AAD. I can get the bearer access jwt token via the C# library IdentityModel and if I parse it I can see all claims in place (meaning the "...
user avatar
0votes
1answer
33views

can't read path variable in firestore rules

I have some rules like: rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /teams/{teamId} { allow read, write, delete, ...
user avatar
  • 521
0votes
0answers
20views

How to add Delete method to avoid Error 405?

I work in a C#.NET framework 4.7.2 project, and I use some code to delete Claims through an OpenID server API: /// <summary> /// Remove old claims /// </summary> public ...
user avatar
0votes
1answer
217views

User.IsInRole() fails when in multiple roles retrieved from Identity Server 4 token

If there is a single role in the token, User.IsInRole() works However, if there are multiple roles, then it does not Here is how the roles are added (seems the same as lots of other posts online) ...
user avatar
  • 641
0votes
0answers
18views

UserName in _Layout.cshtml in DotNet Core 3.1

In my Login post controller I am setting claims like var claims = new List<Claim>(); claims.Add(new Claim("userName", "Jhon")); var userIdentity = new ...
user avatar
1vote
0answers
51views

Can't implement IProfileService properly in Identity Server 4

I have a working authorization setup and obtain a token that contains the below. Seemingly, everything behaves as supposed to, the verification in profiles kicks in as expected etc. { ... "awo&...
user avatar
0votes
0answers
347views

Blazor Server Add Claims after authentication

Hi I want user to select branch to enter after login and user may have different role for each branch. Then this info will be added to user claims. Below is how I implemented IClaimsTransformation ...
user avatar
  • 79
0votes
0answers
54views

Issue claim in ADFS based on relying party identifier

In ADFS a relying party can be identified by multiple identifiers. In my case the relying party trust Foo Relying Party can be identified by urn:mycorp:identifier1 and urn:mycorp:identifier2. My goal ...
user avatar
  • 5,349
1vote
1answer
122views

jwt claim on blazor web assembly and web api claim

when i generate jwt token on server, one of my claim is ClaimType.Name, but in blazor web assembly when i parse jwt token and get claims, it's name changed to unique_name. can anyone explain why this ...
user avatar
0votes
1answer
197views

How do you set userExtension/optional claims using the graph api?

I am writing code to set optional claims. I was successful in setting the claim using PowerShell Set-AzureADUserExtension and validate it with Get-AzureADUserExtension. But we need to set the value ...
user avatar
  • 1
0votes
1answer
73views

How to read a custom claims value

In my application, I have used to store user access in the claims when users log in to the system. So when the user input the user name and the password, return the access types and values then ...
user avatar
0votes
1answer
409views

Adding custom claims to JWT from an external API using Azure AD

Is there a way to add custom claims to a JWT (access token) other than adding the optional claims? Our situation is that we receive requests from external clients with access tokens signed by a ...
user avatar
  • 1
0votes
0answers
625views

Spring Boot JWT Claims Content Loading

Summary: I am unable to get JWT to work with role based access. JWT by itself runs just fine. I have looked at several existing stack overflow responses but have yet to find the information I need. ...
user avatar
1vote
1answer
91views

How to pass additional values to MVC client from Identity Server 4 after authenticating user

How can we pass additional data to Client application from Identity Server 4 in response after successful authentication? We are using Identity Server 4 as an Auth server for our application to have ...
user avatar
0votes
1answer
35views

How can I edit my token claims after after it was created?

I have this application where I get token after I login. I am using Identity Server 4. I'm using authorization grant type as of the moment. The role/s of the user are specified as claims in the Token. ...
user avatar
  • 1,881
1vote
1answer
69views

How to get a value from claims JWT C#

How can I get a BasketId from claims in UserContextService? userId work, but basket isn't standard type. So I need help to get it. That's my try: accountservice: var claims = new List<Claim>() { ...
user avatar
0votes
0answers
20views

MVC: Cannot refresh identity claims after editing user (me too)

I have a customized implementation of Identity infrastructure, where my users have some properties made accessible as claims. Some of these claims are editable by the user. My problem is that when ...
user avatar
  • 761

15 30 50 per page
1
2 3 4 5
10