authorization

Integrating SignalR with existing Authorization

血红的双手。 提交于 2019-12-22 06:40:01
问题 I've been working on a way of integrating SignalR Authorization Attributes with a custom authorization provider (called MVCAuthorization) I went down a few rabbit holes of trying to recreate an Authorization provider for hubs specifically, but that turned out to be far too complicated. So I was wondering, how I can integrate my existing Controller and Action Authorization with my SignalR Hubs and methods? 回答1: I figured out that you can retrieve an IAuthorization provider. If you treat you

How do I restrict permissions based on the single page ID in the URL?

时间秒杀一切 提交于 2019-12-22 05:24:09
问题 I'm trying to implement Pyramid's Security features in my website but I'm having some trouble figuring out how to use it. I've been reading over this tutorial and this example, as well as the Pyramid docs, and I can't figure out how to implement an authorization policy for single page IDs. For example, I have the following URL scheme: /pages /pages/12 /pages obviously lists the available pages and /pages/:id is where you can read/comment on the page. The documentation/examples I've read have

Securing REST endpoint using spring security

点点圈 提交于 2019-12-22 04:13:07
问题 I am trying to provide security to the REST endpoints. I am following instructions from this page. In my case I don't have view hence I haven't created controller to specify the views and haven't added viewResolver in my AppConfig.java After implementation it correctly shows the access denied error upon calling a secured REST endpoint. But even though I specify username/password in the request header I get the access denied error. I am testing in postman setting username/password in Basic

C# FatClient Facebook auth fails: Return URI contains no token

孤人 提交于 2019-12-22 00:34:15
问题 I've been encountering a weird problem when receiving the Facebook oauth response string using System.Windows.Controls.Webbrowser for authentication. Following request URI is sent: https://www.facebook.com/dialog/oauth?client_id=[APPID]&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=publish_stream,read_friendlists,email&response_type=token but what I receive is only https://www.facebook.com/connect/login_success.html , i.e. no access_token. Strangely, copy&paste the

CakePHP/MVC Admin functions placement

…衆ロ難τιáo~ 提交于 2019-12-22 00:22:45
问题 This is a question more for opinions rather than for a solution to a specific problem. I am working with CakePHP for the first time and am working on the admin part of the site now. Where do you, as an MVC or CakePHP developer like to put your admin functions? Initially I was putting them in an AdminController, but have since changed to putting the functions in a controller that is meant for the type of data being manipulated. For example, I put the user listings/editing in the UserController

Apache 2.4 — how to close entire site except one subdirectory?

耗尽温柔 提交于 2019-12-21 21:44:08
问题 We are using the new authentication and authorization framework offered by Apache-2.4 and need to close the entire site (Location /) to unauthorized access except for one subdirectory (Location /foo), where there authorizing cookie can be obtained. It would seem, that AuthMerging is the directive to use, but things do not work: <Location /> AuthType form AuthFormProvider foo Session On SessionCookieName ti2f Include conf/sessionpw.conf AuthName TI <RequireAll> Require foo ipaddress Require

Mixing ASP.NET WebForms and MVC Authorization

。_饼干妹妹 提交于 2019-12-21 21:37:30
问题 I'm trying to mix some MVC3 functionality into an existing WebForms application. I've followed a few guides, and got everything set up and working except for the authorization piece. The existing application has <deny users="*" /> sitting at the root web.config, and each subfolder has its own web.config that allows access to the pages within for specific roles. My new understanding is that this style of can't/shouldn't be used on Controllers, and I should be using Authorize attributes instead

Pundit: auhorize Index in nested resources

风流意气都作罢 提交于 2019-12-21 20:27:36
问题 Using Rails 4.2.4 with Devise (3.5.2) and Pundit (1.0.1). Decent_exposure (2.3.2). I have a simple nested associaton for User and Idea: class User < ActiveRecord::Base has_many :ideas ... class Idea < ActiveRecord::Base belongs_to :user ... In routes.rb devise_for :users resources :users do resources :ideas end Then I am simply trying to disallow access to users/1/ideas if current_user is not the owner of the Ideas (in this example, if current_user.id != 1). I can not figure out how to do it.

How to use CanCanCan with enum field?

我与影子孤独终老i 提交于 2019-12-21 20:26:32
问题 I got Article model with enum field enum status: [:pending, :done] . Here's my ability file class Ability include CanCan::Ability def initialize(user) user ||= User.new if user.member? can :read, Article.done end end end In view I am trying to render Article.done collection for member but nothings renders. <% if can? :read, Article.done %> <%= render partial: 'article', collection: Article.done, as: :article %> <% end %> Therefore I have a question: is there any possible way to work with enum

How to prevent users to access other user's data with dotnet core and RESTful APIs?

↘锁芯ラ 提交于 2019-12-21 20:11:11
问题 I'm trying to find the best solution to a simple problem that is not largely discussed around. My application have lots of users that can create and edit data. An user should only see and edit his data, not other's. Think about Alice, who has a Restaurant A with a Menu MenuA, and Bob, who has a Restaurant B and a Menu MenuB. I have APIs to CRUD restaurants and menus and I can easily only authorize logged users with correct claims and roles. What I want to do now is prevent Bob to access Alice