authorization

Can user authorization be set on a per-controller basis in web.config? (cannot use AuthorizeAttribute)

情到浓时终转凉″ 提交于 2019-12-02 02:02:29
I have a Web API 2 app using windows auth. I have multiple controllers and this in my web.config for authorization: <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> <authentication mode="Windows" /> <authorization> <allow users="AllowedUsersAndGroups" /> <deny users="?" /> </authorization> <sessionState mode="Off" /> </system.web> This "blanket" authorization works great, but I have 2 specific controllers that I need to lock down differently: I want to specify different users that are authorized to hit these 2 controllers . The obvious

Control access on future content

筅森魡賤 提交于 2019-12-02 01:41:17
this is mostly about public content timed on the future, but not only. In a standard Plone site if you create a top-level content is not shown on the navigation (is still private), then you make it public (via workflow) and it shows up on the navigation, but later you time it in the future and again it disappears from the navigation. Still, at that point, if an anonymous/logged-in user knows the URL they will be able to see the content. In our case, a newspaper, we not only have that (content timed to the future) but we also have different roles of users which need or don't have to see that

ASP core login through external (custom) service

折月煮酒 提交于 2019-12-02 01:39:48
问题 I am looking for proper way how to implement authentification and authorization. If I understand it well - this should be realized through "Identity" - it's offering both of these things I need. My problem is that i can't use a database. I have to use a service (WCF service where our internal DDLs are connected to our system) which is able only Login (I give it user name and password) and after login i can get list of permissons. I already saw articles how to have custom UserStore, RoleStore,

Cant get digest auth to work with node.js

回眸只為那壹抹淺笑 提交于 2019-12-02 00:49:12
I'm trying to get a simple (!) digest authentication working with node js using an an API from gathercontent.com. Everything seems to be working except I still get a "Wrong credentials" response that looks like this: { success: false, error: 'Wrong Credentials!' } The code looks like this: var https = require('https'), qs = require('querystring'); apikey = "[my api key goes in here]", pwd = "[my password goes in here]", crypto = require('crypto'); module.exports.apiCall = function () { var options = { host:'abcdefg.gathercontent.com', port:443, path:'/api/0.1/get_pages_by_project/get_me',

ASP core login through external (custom) service

自作多情 提交于 2019-12-02 00:24:05
I am looking for proper way how to implement authentification and authorization. If I understand it well - this should be realized through "Identity" - it's offering both of these things I need. My problem is that i can't use a database. I have to use a service (WCF service where our internal DDLs are connected to our system) which is able only Login (I give it user name and password) and after login i can get list of permissons. I already saw articles how to have custom UserStore, RoleStore, UserManager and SignInManager.. but I am still confused and I don't know how to do it. Is this even

Google Maps Android v2 Authorization failure

左心房为你撑大大i 提交于 2019-12-01 23:59:54
问题 I am testing the sample google code on an actual device having 2.3.6.I thought it might be the problem with the key ,so I created different key on a different account through Google's API Console.Still the same problem "Google Maps Android API-Authorization Failure". Here is the log: 12-07 10:31:30.476: D/dalvikvm(17791): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp 12-07 10:31:30.484: W/dalvikvm(17791): VFY: unable to resolve instance field 24 12-07

Why would .NET suddenly try to serialize my object in my ASP.NET application?

假装没事ソ 提交于 2019-12-01 23:56:37
问题 I run an Azure web role in Full IIS mode. Requests are authorized with custom basic authentication. I have MyAssembly.CustomIdentity class that inherits from System.Security.Principal.GenericIdentity . When HttpApplication.AuthenticateRequest handler ( OnEnter() code from the link above) is invoked it performs checks, then creates an instance of MyIdentity.CustomIdentity and assigns it to HttpContext.Current.User . Then an actual ASP.NET request handler obtains that object and can use it to

.NET WebAPI centralized Authorization

北战南征 提交于 2019-12-01 22:52:00
In .NET WebAPI, I've created a way to have all of the authorization rules in a central location, rather than scattered throughout controllers. I'm curious why this centralization isn't done more often; are there repercussions/security concerns? My current approach is to create a Dictionary during App_Start that contains all of my Authorization data then using a DelegatingHandler to apply the restrictions (code below). The dictionary key is a Tuple of the Controller and Action, and the value is the authorized roles. The DelegatingHandler ties into WebAPI's routing config to get which controller

Limitations of using a PhaseListener instead of a Servlet Filter for authorization

蹲街弑〆低调 提交于 2019-12-01 22:08:07
问题 I'm currently using a PhaseListener as below to perform user authorization. private PhaseId phaseId = PhaseId.RESTORE_VIEW; @Override public void afterPhase(PhaseEvent event) { FacesContext fc = event.getFacesContext(); boolean isOnAllowedPage = false; String[] allowedPages = choseRightPages(); // chose pages for role for (String s : allowedPages) { if (fc.getViewRoot().getViewId().lastIndexOf(s) > -1) { isOnAllowedPage = true; break; } } if (!isOnAllowedPage) { NavigationHandler nh = fc

Limitations of using a PhaseListener instead of a Servlet Filter for authorization

落花浮王杯 提交于 2019-12-01 21:47:25
I'm currently using a PhaseListener as below to perform user authorization. private PhaseId phaseId = PhaseId.RESTORE_VIEW; @Override public void afterPhase(PhaseEvent event) { FacesContext fc = event.getFacesContext(); boolean isOnAllowedPage = false; String[] allowedPages = choseRightPages(); // chose pages for role for (String s : allowedPages) { if (fc.getViewRoot().getViewId().lastIndexOf(s) > -1) { isOnAllowedPage = true; break; } } if (!isOnAllowedPage) { NavigationHandler nh = fc.getApplication().getNavigationHandler(); nh.handleNavigation(fc, null, "prohibited"); } } It does what I