claims-based-identity Questions

6

This error occurs while trying to add-migration for the first time. I have added the extension method and my service class public void ConfigureServices(IServiceCollection services) { services.Ad...

4

Solved

I need to access ClaimsPrincipal within the service layer of a Net Core 6 app. I could always just builder.Services.AddTransient<IHttpContextAccessor, HttpContextAccessor>(); in the Startup.c...

7

Solved

I'm trying to learn Claims for MVC 5 OWIN login. I try'ed to keep it as simple as possible. I started with the MVC template and inserted my claims code (see below). I get an error when I use the @H...

6

Solved

Why do I want this? I'm trying to get a unique identifier from my user which I can connect to database records. There are reasons I don't want to use the Email as the identifier. I read that SUB c...

5

Solved

Below is a simplified version of where I am trying to set Thread.CurrentPrincipal within an async method to a custom UserPrincipal object but the custom object is getting lost after leaving the awa...

4

Solved

How can I set the CookieDOmain in the CookieAuthenticationOptions at runtime if i want to pull this value from the Request.Url or from some settings stored in my database? I want to support sub-do...
Trochophore asked 10/4, 2014 at 13:47

4

Solved

I am making a developer tool for impersonating Roles for an intranet site to allow developers to quickly act as any Role as needed. Roles defined are Developer, Team Lead, Team Member, Engineering,...
Shelashelagh asked 21/3, 2014 at 22:36

7

I would like to know if it is always recommended to use Managed Identities in Azure , mostly system assigned or a Service Principal? When should Service Principals be used in Azure compared to a ma...
Xantho asked 20/4, 2020 at 12:3

3

Solved

In AuthController when authenticating I create a few Claims - UserID is one of them. ... Subject = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, user.UserName), new Claim("UserID", user....
Distraction asked 1/7, 2018 at 2:18

3

Solved

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: ...
Boar asked 12/5, 2020 at 20:55

6

Solved

Problem We want to use Windows Active Directory to authenticate a user into the application. However, we do not want to use Active Directory groups to manage authorization of controllers/views. A...

2

Solved

How can I create a custom authorize claim in MVC Core 2.0 (using AspNetCore.identity) to verify a custom user boolean property? I have extended the IdentityUser (ApplicationUser) to include a boole...

4

Solved

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...

3

Solved

I have created multiple authorization policies, each with 1 claim in it, doing a role check, like so: options.AddPolicy("SuperAdminPolicy", policy => policy.RequireClaim(ClaimTypes.Role, "Super...

5

Solved

Using thinktecture JWT authentication resource owner flow, I use the claims part of JWT for client consumption. My question is that if it's possible to add a claim in identity server and decode it ...

2

Solved

I use the following code to update the claims of a user in my web application. However, to update the claims/cookie of this user, I want to force him to login again. So essentially I want to expire...
Igbo asked 27/7, 2017 at 10:20

5

Solved

I'm writing an ASP.Net Core Web Application and using UseOpenIdConnectAuthentication to connect it to IdentityServer3. Emulating their ASP.Net MVC 5 sample I'm trying to transform the claims receiv...
Urinate asked 19/8, 2016 at 10:34

4

Solved

I have a method to update user claims within our app. I am logged as an admin user who can edit other users. I am trying to remove existing claims of one user and assign new ones. When removing ...

5

Solved

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 ex...
Hulahula asked 8/11, 2012 at 10:9

4

Solved

The scenario is the following: I need to perform a federated authentication of a user (which uses his university account) into the Sharepoint site of his university and to obtain both the FedAuth a...
Phenobarbital asked 19/8, 2014 at 16:39

1

Solved

So when I add policy-based authorization to the Startup.cs file and then add AuthorizeView to my Blazor page, I get an error: crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssembly...

12

Solved

What are the main benefits of using CBAC vs. RBAC? When is it better to use CBAC and when is it better to use RBAC? I'm trying to understand the general concepts of the CBAC model but the general...

5

Solved

I am using Identity v2 and MVC 5 for external login. In my external login callback function, I log the user in with var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: ...
Shotten asked 2/7, 2015 at 13:15

5

Solved

I am completely new to the use of claims in ASP.NETIdentity and want to get an idea of best practices in the use of Roles and/or Claims. After all this reading, I still have questions like... Q: ...
Seafowl asked 21/6, 2015 at 1:1

4

I have created a new ASP.NET MVC application with .NET 4.5. I have successfully set up authentication with an STS. The authentication flow is working fine and I am able to get the ClaimsIdentity, c...
Publishing asked 29/12, 2012 at 16:57

© 2022 - 2025 — McMap. All rights reserved.