authorize

Override Authorize Attribute in ASP.NET MVC

I have an MVC controller base class on which I applied the Authorize attribute since I want almost all of the controllers (and their actions along) to be authorized. However I need to have a controller and an action of another controller unauthorized. I wanted to be able to decorate them with the [Authorize(false)] or something but thi...

Authorize attribute does not preserve post data

In order to preserve post data after utilizing the [Authorize] attribute on a controller method, which then redirects the user to a login page, which then upon successful authentication redirects the user to where they were intending to go -- how would this be done? The original form submission is not relayed by default. A response to a ...

More control on ASP.Net MVC's Authorize; to keep AJAX requests AJAXy

I have some action methods behind an Authorize like: [AcceptVerbs(HttpVerbs.Post), Authorize] public ActionResult Create(int siteId, Comment comment) { The problem I have is that I'm sending a request through AJAX to Comment/Create with X-Requested-With=XMLHttpRequest which helps identify the request as AJAX. When the user is not l...

Is ASP.Net (MVC) redirecting to the log in form when I generate a HttpUnauthorizedResult?

I'm actually using ASP.Net MVC, but I think this applicable to ASP.Net as well. Investigating how authorization works I've reached the conclusion that ASP.Net MVC generates an HttpUnauthorizedResult when the user is not authorized and should be. And then ASP.Net reads from my Web.config: <authentication mode="Forms"> <forms loginUrl...

Is the [Authorize] attribute for ASP.NET MVC controllers only for Membership Providers?

Does the [Authorize] attribute used with ASP.NET MVC controllers only function with sites that have implemented a MembershipProvider? ...

Asp MVC [Authorize] to return a Post instead of a Get

I would like to use [Authorize(Roles="Admin")] tags on my controller methods. If a user is not an admin I would like to return this user to my login screen. The default behaviour of returning the user to my login page is reroute my user to "Account/Login" using a Get url. The problem is, my website's subpages are all partial views refr...

What is the best mechanism to implement granular security (i.e. authorization) in an ASP.NET MVC application?

Suppose a high-speed developer was tasked with building a banking application which would be accessed by many different people. Each person would want to access his or her own account information but would not want others to access it. I would like to know the best practice for restricting access in an MVC application so that only the us...

MVC 1.0 & the Authorize Attribute Not Working?

I'm writing an application with MVC and I'm at the point where I need to start applying the authorization checks but I can't get them to work under any conditions. I'm using Windows Authentication on a system that's a member of an internal domain. Authentication works fine, and the roles are populated as well. But no matter what value I ...

ASP.NET MVC custom authorization

I am building a web application using ASP.NET MVC that has two very distinct types of users. I'll contrive an example and say that one type is content producers (publishers) and another is content consumers (subscribers). I am not planning on using the built-in ASP.NET authorization stuff, because the separation of my user types is a di...

asp.net authorization using url

This question has problably been asked before, but it seems like I can't phrase my search correctly enough to find the answer. Normally when you sign up to get access to a forum on the internet, an authorisation email is sent to you and you can click a link which leads you to a page which performs the authorisation. What I want is to s...

Authorization and ASP.NET MVC Caching

I'm confused on ASP.NET MVC caching and authorization and in dire need of some clarification. My self-made authorization attribute inherits from AuthorizeAttribute. It's overridden AuthorizeCore() method runs every time, even if I set an [OutputCache] directive on a controller action. I got that part. Now the mind bender for me: Author...

Authorization and Windsor

I'm trying to implement my custom authorize attribute like: public class MyCustomAuth : AuthorizeAttribute { private readonly IUserService _userService; public MyCustomAuth(IUserService userService) { _userService= userService; } ... continued } I am using Castle Windsor for automatically resolve the depende...

How can I assign a value to HttpContext.User in ASP.NET MVC ?

I write a controller like below: public class AccountController : Controller { public ActionResult Login(/*---*/) { GenericIdentity identity = new GenericIdentity("userName"); GenericPrincipal principal = new GenericPrincipal(identity, new string[] { "role1", "role2" }); this.HttpContext.User = principal;...

How should i organize authority code?

I have users that fall into the following Not logged in Not Verified Verified Moderator Admin All code that only admin and moderators can access (like banning) is in ModeratorUser which inherits from verified which inherits from BaseUser. Some pages are accessible to all users such as public profiles. If a user is logged in he can le...

What is the best way to connect two users with credit card for payments on the web site?

What is the best way to allow one site user to pay to another user, through web site using credit card? What is best fits for this Paypal Pro or Authorize.net? ...

What's the best way to authorize a USB Key

We have an auto update for our software that is installed via USB key (with the auto run). If I wanted to ensure that only authorized USB Keys were used, what's the best way? Our installer is already signed, and it won't run otherwise. But I'm more wanting to inspect the USB Key for a signed installer, and if it's not there, just ignore...

Update payment details using Authorize.net

Hello everybody, When i update the existing subscription info using update_recurring method of autorize.net gateway then payment details(means 'credit card number', 'CVV number' and 'expiry date' ) are not being updated. My code snippet is as follows:- def create_card_subscription credit_card = ActiveMerchant::Billing::CreditCar...

Authorize and then Capture programmatically using Authorize.Net in Magento

Can anyone help me in getting the Authorization and the Capture steps (code) using Authorize.Net? It seems that everyone knows how to use both at the same time, however, there is no explanation as how we can do that into spearate steps, the Authorize first and the Capture after that (using a trasactionID). ...

How do you define the login page you want unauthorized user to be redirected to

I have decorated my controller with an Authorize attribute, as so: [Authorize(Roles="ExecAdmin")] If I try to go to that controller after logging in as a user who is not ExecAdmin, it does appear to be attempting to redirect to a login page. BUT, the page it is attempting to redirect to is not my login page, it is a view called LogOnU...

check permission against group not users using Auth->authorize="actions"

Hello folks, Can any one explain me the working of Auth->authorize = "actions" In my project i am planning tp give this. As this taught me the authorize will call the $this->Aro->check($user,"controllers/:controller/:action") This will check the against the user right?? that means the user should be there in aros table. But i don't ne...