asp.net-authorization Questions

10

I'm trying to implement JWT authentication on my asp.net core webAPI as simply as possible. I don't know what i'm missing but it's always returning 401 even with the proper bearer token. here is m...
Profitable asked 23/5, 2020 at 18:42

4

Currently, I am adding an authorization header to my request like this: File: SomeFile.cs public interface ITestApi { [Get("/api/test/{id}")] Task<string> GetTest([Header("Authorization")...
Pyrostat asked 19/10, 2018 at 7:17

2

I'm attempting to pass an access_token through a HubConnection in a C# .NET Client. However, the result is not consistent with what I'm seeing through a TypeScript client. And this inconsistency re...
Hua asked 12/12, 2019 at 21:38

2

Solved

I've decided to write a custom AuthorizationHandler for a custom Policy I'm using : // I pass this to AddPolicy in startup.cs public class MyRequirement : IAuthorizationRequirement { public MyReq...

1

Solved

I have implemented the Azure AD Authentication in ASP.Net Core 6 using the standard way and have used the [Authorize] attribute on top of the controller class. All these are working fine. builder.S...

3

Solved

I created a Server side Blazor application using Windows authentication. And it created the following file. LoginDisplay.razor <AuthorizeView> Hello, @context.User.Identity.Name! </Auth...

1

Solved

I need to combine token and cookies for authorizing requests in wepapi project. I have added Cookies and Jwt for authenticating requests. Before changing DefaultPolicy, I can get my claims(/info), ...

2

Solved

I want to set [Authorize] data attribute to the application rather then controllers [Authorize] public class CustomerController : Controller {} With this [Authorize] I can set authorization only f...
Estimative asked 1/3, 2022 at 21:3

2

Solved

I want to create a custom authorization attribute for checking the role and url path. I've find the way for doing it in the Asp.Net Core using the Policy-Based-Authorization but I've tried impleme...
Cerracchio asked 8/1, 2017 at 14:44

2

Solved

ASP.NET Core 2 Help me to configure AddAuthentication for two routes: users (user accounts) and admin area. For example, if user doesn't signed in and trying to enter /Account/Orders/ he'll be r...

2

Solved

Being relatively new to ASP MVC, I'm unsure which would better suit my needs. I have built an intranet site using Windows authentication and I'm able to secure controllers and actions using the Act...

1

Solved

I have a list of claims that are required to do certain operations in the system. I have a list of policies to verify the existence of those claims to perform certain operations. That all works as ...

2

Solved

I am planning to change the ASP.NET Web API 2.0 which includes Authentication and Authorization and all the services into Microservices architecture. My Question if I create a central microservice...

1

Solved

How do you implement authorization for a list of resources? All docs I see are based on IAuthorizationService and the AuthorizeAsync methods. But this, only applies to one resource. Should I be ...

1

Solved

I'm having difficulty accessing session data in a custom authorization handler, while it works elsewhere. Session works properly in controller actions, but when I try to access it with IHttpContex...
Meaningless asked 5/3, 2020 at 11:9

2

Solved

I have a .NET core project and am trying to create a custom policy using AuthorizationOptions as shown in the documentation located here: ASP.NET.Core Authorization - Dependency Injection in requi...

2

Solved

How to force / set global authorization for all actions in MVC Core ? I know how to register global filters - for example I have: Setup.cs services.AddMvc(options => { options.Filters.Add(ne...

3

Solved

I am trying to implement an IdentityServer4 with Asp.Net Core Identity. I want to use IdentityServer4 as centralized authentication/authorization point for APIs using always the same identity. So t...

1

I'm starting with ASP.NET Identity's Claim authorization and I would like to clarify the way of proceeding with them if I need the "roles" concept in my app. Note: I'm really new with this, so all...

0

We have few asp.net 4.5 applications that share authentication cookies (SSO) secured by a web config machinekey and I wont change them. ASP.NET 4.5 sign in: var auth = FederatedAuthentication.S...
Endothelium asked 14/8, 2018 at 16:0

1

Solved

Is this an acceptable implementation of a custom bearer token authorization mechanism? Authorization Attribute public class AuthorizeAttribute : TypeFilterAttribute { public AuthorizeAttribute(...
Scots asked 29/3, 2018 at 8:11

1

I am wondering if someone could point me a direction or an example which have the completed code for me to get an overall idea? Thanks. Update: I only have following piece of code in Startup.cs a...

1

Solved

I want to secure specific folders and resources in my application that are outside of the routes for my mvc application. I want these resources to only be available to authenticated users (which ro...

1

Solved

I'm trying to rewrite some authorization I currently have for ASP.NET 4.6 in ASP.NET Core. I understand that Authorization has changed a bit, and I find it difficult to implement my very simple au...

1

Solved

We have a calling client requesting to our system that does not place the Bearer token in the standard place ('Authorization' header) I would like to create a custom handler that looks for the JWT ...

© 2022 - 2024 — McMap. All rights reserved.