Questions tagged [authorize]

257 questions
84
votes
4 answers

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…
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
35
votes
3 answers

Authorize attribute and jquery AJAX in asp.net MVC

I have used jquery ajax function to submit a form. The users have to be logged in else they must redirect to a login page.I have used Authorize() attribute for it. [Authorize] public ActionResult Creat() { .... } If the user is not login the action…
Ghooti Farangi
  • 19,926
  • 15
  • 46
  • 61
19
votes
2 answers

What exactly does Owin rememberBrowser do?

In several places in a standard ASP.Net MVC Identity 2.0 Owin implementation you'll see rememberBrowser, like: await signInManager.SignInAsync(user, isPersistent: isPersistent, rememberBrowser: false); If you do set rememberBrowser to true, I've…
Chris Moschini
  • 36,764
  • 19
  • 160
  • 190
13
votes
2 answers

Swagger/Swashbuckle Authorize. Scopes checked by default

Is it possible to set an auth scope checkbox checked by default on Swashbuckle UI on a asp.net Core 2.0 Web API?? I use the "openid" scope and I'd like to have it checked every time. Thank you.
Toni
  • 173
  • 8
11
votes
4 answers

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…
Anthony Gatlin
10
votes
2 answers

How to Extend/Architect the ASP.NET MVC 3 Authorize Attribute to Handle This Scenario

I've been trying to think this answer through and can't find a good solution on how to properly do this. I've read over these…
Mastro
  • 1,477
  • 2
  • 22
  • 52
9
votes
2 answers

Check authorize in SignalR attribute

i have some services on ServiceStack and use SignalR in this project. And now, i would like to secure hub connection (access only for authenticated users), but i use ServiceStack framework authentication.. (not asp.net authentication) and…
Alexander Krylov
  • 815
  • 1
  • 6
  • 7
8
votes
5 answers

How to authorize a set of controllers without placing the annotation on each one?

I have sets of controllers which are each used for each authorization type. For example, a class A authorization will have a set of controllers each which require class A authorization. Is there a way to place one [Authorize(Role="Class A")]…
Travis J
  • 81,153
  • 41
  • 202
  • 273
8
votes
4 answers

ASP.NET Web API role based authorization based on route parameter

I'm using roles in my ASP.NET Web API 2 project to limit access to certain resources. Now I have the following scenario: A clubmanager can only do a GET for a club that he manages. A clubmanager should not be authorized to access clubs that he does…
Tom
  • 83
  • 1
  • 3
8
votes
1 answer

ASP .Net MVC 4 Authorize and AllowAnonymous

I am completely new with this framework and I am still learning the basics of it and C#. Meanwhile, I came across with the attributes Authorize and AllowAnonymous while reading a book and I can't understand how a controller "knows" if the user…
João Martins
  • 1,026
  • 2
  • 14
  • 35
7
votes
3 answers

Facebook authorize w/permissions request yield "Page Not Found"

Somewhere along the way in the past few weeks, the authorize Facebook call in iOS fails with a "Page Not Found". This happens for any user that has not installed the app or if the app's permissions have changed and the user must approve the…
bill.lee
  • 2,207
  • 1
  • 20
  • 26
7
votes
1 answer

Using a policy's this->authorize() check in a laravel controller inside a store() method

So I was reading about using laravel policies for granting authorities on the resources of my application but there seems to be a problem there though I followed the tutorial. I have a user model which can't be created via HTTP requests except by…
Ramy Farid
  • 144
  • 1
  • 2
  • 15
7
votes
1 answer

MVC 4 Forms Authentication not working with [Authorize]

I'm learning MVC4 right now, and I am following the Pro ASP NET MVC4 4th edition book to create a Sports Store project. I have always developed in webforms, and I am trying to figure out how the forms authentication is working in MVC4. Here is what…
Carlos Landeras
  • 11,025
  • 11
  • 56
  • 82
6
votes
3 answers

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?
KingNestor
  • 65,976
  • 51
  • 121
  • 152
6
votes
2 answers

mvc 3, jquery ajax & forms authentication

In my MVC3 project, I have a controller with an [Authorize] attribute. I have a form submission without ajax, which redirects the user (as expected) to the login screen, if he/she is not logged in. However, now I have a form which is submitted…
Nima
  • 937
  • 1
  • 13
  • 20
1
2 3
17 18