Questions tagged [claims-authentication]
43 questions
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…

Wijitha
- 1,189
- 2
- 12
- 22
6
votes
1 answer
Does ASP.NET Core Identity uses Sessions for authentication?
Does ASP.NET Core 3.1/5 Identity uses Sessions for authentication? I know it uses cookie to store user information on the client machine for next requests, but thing which i don't understand is that, is only cookie enough or does it also created any…

Nick Money
- 89
- 2
- 6
5
votes
1 answer
Refresh Token automatically and add new User Security Groups Azure AD
I have a simple ASP.Net Web-APP using Azure AD with Role/Claims Authentication/Authorization. Basically app checks IsinRole() for the user and then depending on what is returned he gets access to the area of the web-app. We are using SECURITY GROUPS…

user42012
- 722
- 12
- 33
4
votes
1 answer
Azure AD v2.0-specific optional claims missing from ID Token
I'm trying to add optional claims using Microsoft Identity Web - NuGet for user authentication in NET Core 3.1 WebApp. Reading the MS Docs, it seems that the only steps needed are to declare the optional claims within the App Registration Manifest…

OJB1
- 2,245
- 5
- 31
- 63
3
votes
5 answers
Golang jwt.StandardClaims time format type issue
I am using this package github.com/dgrijalva/jwt-go/v4 to set up claims in a Login function:
now := time.Now()
claims := &jwt.StandardClaims{
Issuer: "Test",
ExpiresAt: now.Add(time.Hour * 24).Unix(),
}
The IDE keeps telling me:
Cannot use…

porterhaus
- 439
- 2
- 5
- 17
1
vote
1 answer
.NET read roles from comma separated string instead of from array
In my JWT I have a list of roles like this: {..., role: "1,2,3", ...}. When my request hits [Authorize(Role = "1")], it returns unauthorized.
Is there a way to parse this comma separated string into an array of roles on my AddAuthentication or…

Estevão Dias
- 11
- 1
1
vote
0 answers
Show/Hide nav menu based on claims Identity ASP.NET CORE (not role base)
I've successfully implemented role and claim (policy) based authorisation in my app. I'm using ASP.NET CORE 7 MVC. The top menu navigation is hidden base on the login user's role something like this:
@if (User.IsInRole("Admin"))
{

Jeff
- 115
- 7
1
vote
2 answers
Missing new user flag in token claim: Azure B2C
We created Sign Up and Sign In userflow for our B2C application to authenticate users.
To identify the user selected option i.e, sign up or sign in, we added "User is new" application claim to our user flow:
But when we generate the token, we…

Shawne49
- 25
- 5
1
vote
1 answer
Identify users login type like Sign up or Sign In
We created Sign Up and Sign In userflow for our B2C application to authenticate users.
Everything is working fine. But I want to categorize signed in users and signed up users.
I checked the logs but there is no much difference. How to identify who…

Shawne49
- 25
- 5
1
vote
1 answer
How to add new claims to claim array using foreach loop in C#?
I want to add new claims to a claim array in a foreach loop. How to do that?
//userRoles is a list of string contains roles.
var userRoles = _repository.GetRolesOfUser(username);
var claim = new[]
{
new…

StarLord
- 707
- 1
- 8
- 21
1
vote
1 answer
How can I add/update a claim in .NET Core 3.1 after I've already authenticated?
In my scenario, I have a many-to-many relationship between users and businesses. So, a business can have many employees, and a user can be an employee to many businesses.
On the login page, I only want to show email & password textboxes. Once they…

Jason T
- 13
- 3
1
vote
0 answers
.Net Core 3.1 ClaimsTransformation Manually Added Claims Not Persisting
I will be accessing several tables to determine if a user is "Validated" or not as well as adding custom roles to a Windows authenticated user for authorization. For now I'm running a test in a basic .net Core web application just to see how I…

Kevin Fizz
- 197
- 1
- 2
- 8
1
vote
1 answer
Claims-based authorization and where to add what the user can do
I just implemented a web api using claims-based authorization. A user can login in the system and a set of claims are pulled from the database and added to the httpContext.User.Identity depending on what the user can do.
After registering the…

Notbad
- 5,936
- 12
- 54
- 100
1
vote
1 answer
Proper way to subscribe to and get and propagate Firebase custom claims to components in Angular from a single service
I am trying to find/create a proper (the best) way to get and use custom claims in an Angular app. I added an admin custom claim via a cloud function. What I want to have (and what I tried to do until) now is:
Get the claims (and the logged in…

Filip Savic
- 2,737
- 1
- 29
- 34
1
vote
1 answer
Role based Menu display in cookie authentication with claims identity in asp.net core MVC?
I need the best ways to do role based menu navigation.
My application is in Asp.net core MVC and I have used cookie-based authentication.
And I am using claims identity.

Poonam Londhe
- 11
- 4