Questions tagged [authorization]

Authorization is the process of determining whether a user, program or device is allowed to access a protected resource in a particular way. Authorization is a key theme in computer security practices.

Authorization is distinct from authentication but the two are often used together.

In Role Based Access Control (RBAC), an authorization decision may be dependent upon the identity of the user - whether the user is a member of a given role or group. This usually requires that the authorization authority know and understand the users identity and their membership in various groups or roles.

In Attribute Based Access Control (ABAC), an authorization decision may be based upon attributes provided by a trusted authority. These attributes may be indirectly associated with the user making the access request, but the authorization decision can be made even if the authorization authority does not know or recognize the identity of the user. (See SAML claims and assertions)

Authorization is sometimes abbreviated as "AuthZ", while authentication is "AuthN".

8893 questions
67
votes
5 answers

Restrict access to a specific controller by IP address in ASP.NET MVC Beta

I have an ASP.NET MVC project containing an AdminController class and giving me URls like these: http://example.com/admin/AddCustomer http://examle.com/Admin/ListCustomers I want to configure the server/app so that URIs containing /Admin are only…
Dylan Beattie
  • 50,029
  • 31
  • 120
  • 189
67
votes
5 answers

Token Based Authentication in ASP.NET Core (refreshed)

I'm working with ASP.NET Core application. I'm trying to implement Token Based Authentication but can not figure out how to use new Security System. My scenario: A client requests a token. My server should authorize the user and return access_token…
67
votes
4 answers

Multiple HTTP Authorization headers?

Is it possible to include multiple Authorization Headers in an HTTP message? Specifically, I would like to include one of Bearer token type (passing an OAuth access token) and one of Basic type (passing a base64 encoded username:password). GET…
lewiada
  • 1,077
  • 1
  • 9
  • 13
67
votes
8 answers

Authorization header missing in PHP POST request

I'm currently trying to read the authorization header in a PHP script that I'm calling with a POST request. The Authorization header is populated with a token. It seems the Authorization header is somehow removed before it arrives at my PHP script.…
jimmy
  • 3,481
  • 3
  • 16
  • 27
64
votes
1 answer

How can I delegate JAAS authorization checks to Shiro?

I'm developing a server-side application that needs authentication and authorization based on objects. I like Shiro's simplicity, but for being compatible with JAAS, I wrote a LoginModule that uses Apache Shiro as the underlying mechanism. But my…
Deniz Acay
  • 1,304
  • 1
  • 11
  • 21
64
votes
3 answers

React Router Authorization

What are the best practices for authorization checking prior to a component mounting? I use react-router 1.x Here are my routes React.render((
theo
  • 674
  • 1
  • 5
  • 9
62
votes
4 answers

Authorization header missing in django rest_framework, is apache to blame?

I've managed to extend TokenAuthentication and I have a working model when using the request session to store my tokens, however when I attempt to pass Authorization as a header parameter as described here, I noticed that my Responses come back…
61
votes
9 answers

How to generate access token using refresh token through google drive API?

I have completed steps of authorization and obtained access token and refresh token. What should I do next to generate access token using refresh token that I have stored through google drive API? I won't be able to use any sdk since I am working on…
Niranja
  • 1,111
  • 2
  • 15
  • 19
60
votes
6 answers

User authentication and authorisation in ASP.NET MVC

What is the best method for user authorisation/authentication in ASP.NET MVC? I see there are really two approaches: Use the built-in ASP.NET authorisation system. Use a custom system with my own User, Permission, UserGroup tables etc. I'd prefer…
Neil Barnwell
  • 38,622
  • 28
  • 141
  • 213
59
votes
7 answers

How can we set authorization for a whole area in ASP.NET MVC?

I've an Admin area and I want only Admins to enter the area. I considered adding the Authorized attribute to every controller in the Admin area. Isn't there an elegant solution or is this feature not there in the framework itself? EDIT: I'm sorry, I…
58
votes
13 answers

Should unauthorized actions in the UI be hidden, disabled, or result in an error?

This is a perennial question for me that I've never really resolved so I'd like your input. If I have actions that I know a user will not be able to perform due to insufficient privileges or object state, should the UI elements for those actions be…
tvanfosson
  • 490,224
  • 93
  • 683
  • 780
58
votes
5 answers

Accessing post or get parameters in custom authorization MVC4 Web Api

Is it possible to access post or get parameters via the HttpActionContext object? I have a set of sensors that loggs data to a web server that provides a REST api. I would like to introduce some sort of authentication/authorization by letting the…
olif
  • 2,781
  • 1
  • 21
  • 22
56
votes
2 answers

Difference between Passport and JWT?

I'm pretty new to Express/Node - I'm trying to figure out what the difference between Passport and JWT is but can't find a definitive answer? I know you can use one or the other for auth purposes in an application, or together with an npm package…
AloeVeraForty
  • 713
  • 2
  • 6
  • 9
55
votes
2 answers

Extend AuthorizeAttribute Override AuthorizeCore or OnAuthorization

Using ASP.NET MVC I am creating a custom Authorize attribute to take care of some custom authorization logic. I have looked at a lot of examples and it is pretty straight forward but my question is which method is best to override, AuthorizeCore or…
Nick Olsen
  • 6,151
  • 9
  • 51
  • 74
55
votes
5 answers

ASP.NET MVC Forms Authentication + Authorize Attribute + Simple Roles

I'm trying to add simple Authentication and Authorization to an ASP.NET MVC application. I'm just trying to tack on some added functionality to the basic Forms Authentication (due to simplicity and custom database structure) Assuming this is my…
Kevin
  • 1,653
  • 2
  • 17
  • 16