authorization

WCF Authorization - access to operations via claims

独自空忆成欢 提交于 2019-12-04 17:13:56
I am trying to implement authorization for a WCF service but I have run into some significant difficulties. I think I need to use a hybrid solution combining custom authentication and claims, but I am not sure if this is correct. My application uses Windows authentication to connect to the application. Once the user has been authorized, access to functions needs to be granted based on permission information stored in the database. Users can be assigned permissions via the application interface. One level of the permission heirarchy corresponds to access to individual WCF functions: Access to

Any way to use Authorization Policies in a view in .NET Core 1.0 MVC?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 17:11:25
问题 I know in controllers, you can write [Authorize("policyName")] without an issue, but is there any way to use a policy in a view? I'd rather not use User.IsInRole(...) every single time I want to authorize some HTML. Edit: Here's some code Startup.cs -- Policy Declaration services.AddAuthorization(options => { options.AddPolicy("testPolicy", policy => { policy.RequireAuthenticatedUser() .RequireRole("RoleOne", "RoleTwo", "RoleThree") .RequireClaim(ClaimTypes.Email); }); }); Admin Controller

Vimeo API AuthorizationUrl Without Login

允我心安 提交于 2019-12-04 17:09:59
I'm using Vimeo API to get video on a web application context and i have a simple question (i hope :P ) It´s possible to do a request for application authorization using oAuth protocol and via the following link: https://vimeo.com/oauth/authorize?oauth_token=XXXX , WITHOUT force the user to login in browser? I noticed that if I'm not logged on Vimeo, when I go to https://vimeo.com/oauth/authorize?oauth_token=XXXX , Vimeo redirects me to the login page... Thanks. JMarques I found it =) You can create the access token using the application credentials or using the login data. In this case you

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

☆樱花仙子☆ 提交于 2019-12-04 16:50:54
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 foo expiration </RequireAll> ErrorDocument 401 /foo/ </Location> <Location /foo> AuthMerging Or Require

Implementing Security in REST?

跟風遠走 提交于 2019-12-04 16:41:13
I am concerned on how to implement security measures may it be Authentication or Authorization.. How can these be implemented.. if you have any thoughts or links that you can share with regards to WCF REST 4.0 Security and if you've implemented it also the better. because ive been trying to find out on this topic all i find is information on how to implement it using 3.5 and lower versions which seem to be different from the samples i see for 4.0 which i tried but did not make sense while implementing it. Thank you Because REST is stateless you cannot use a cookie or session id. It is common

Rails Dynamic Role-Based Authorization plugin?

血红的双手。 提交于 2019-12-04 15:49:05
There are a lot of role-based authorization plugins out there. They work great when you know in advance what the roles are going to be. For example, if I know I'm going to have administrators, super_users, and not_so_super_users. What I really want is to be able to create custom roles and assign that role to a user. At this point, I am simply wanting to block access to controllers / actions based on a user's custom role. Roles will consist of permissions. For example, Jane Doe can add and view widgets, but she can't delete or edit them. John Doe can add, view, and edit. The Boss can add, view,

Rails 3 company account with many users, restrict access to data

血红的双手。 提交于 2019-12-04 15:35:57
I'm wondering about the best way to structure authentication/authorization in my app. I want to have many company accounts, possibly using subdomains account has many users and users can only access records that were created by themselves or another user with the same account. The research I've done provides lots of mix n' match ideas for combining devise / cancan / authlogic in weird and wonderful ways, but I've yet to find anything which shows me the best way to restrict user access to data within the same model. So for instance: Account 1: Eurasia User 1: Bob User 2: Jim Account 2: Eastasia

How to use CanCanCan with enum field?

南笙酒味 提交于 2019-12-04 15:21: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 in CanCanCan? I may be wrong, but I think that enum only creates instance methods: . @article =

Intercept request and check authorization in playframework

此生再无相见时 提交于 2019-12-04 15:07:08
问题 I'm using play framework 2.4.2 with Java and I want to validate that a user is logged in by intercepting all requests and checking if a session value is set. So I have extended the DefaultHttpRequestHandler and overridden the createAction Method to intercept all requests. However, I have not found a good way to validate the session. Option 1 - Fail When I try to fetch the session value I get a runtime exception: There is no HTTP Context available from here Below is the class I'm working with:

Kerberos Authorization w/ Node.js

随声附和 提交于 2019-12-04 14:44:41
I have found many different node.js authentication modules. Ei passport-kerberos. But I am looking to make background https calls to another kerberos authenticated site w/ an authorization token. Does anyone know of any modules for getting an authorization token from credentials in a node app? 来源: https://stackoverflow.com/questions/22724978/kerberos-authorization-w-node-js