authorization

django: User Registration with error: no such table: auth_user

拥有回忆 提交于 2019-11-28 19:12:47
I try to use Django's default Auth to handle register and login. And I think the procedure is pretty standard, but mine is with sth wrong. my setting.py: INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'books', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages

WCF - Windows authentication - Security settings require Anonymous

若如初见. 提交于 2019-11-28 19:06:32
I am struggling hard with getting WCF service running on IIS on our server. After deployment I end up with an error message: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. I want to use Windows authentication and thus I have Anonymous access disabled. Also note that there is aspNetCompatibilityEnabled (if that makes any difference). Here's my web.config: <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> <bindings> <webHttpBinding> <binding name="default"> <security

ASP.Net Core 2.0 mixed authentication of JWT and Windows Authentication doesn't accept credentials

点点圈 提交于 2019-11-28 18:55:27
I've API created in asp.net core 2.0 where I am using mixed mode authentication. For some controllers JWT and for some using windows authentication. I've no problem with the controllers which authorize with JWT. But for the controllers where I want to use windows authentication I am indefinitely prompted with user name and password dialog of chrome. Here my sample controller code where I want to use Windows Authentication instead of JWT. [Route("api/[controller]")] [Authorize(AuthenticationSchemes = "Windows")] public class TestController : Controller { [HttpPost("processUpload")] public async

ASP.NET MVC - Dynamic Authorization

社会主义新天地 提交于 2019-11-28 18:54:04
I am building a simple CMS in which roles are set dynamically in the admin panel. The existing way of authorizing a controller method, adding [Authorize(Roles="admin")] for example, is therefore no longer sufficient. The role-action relationship must be stored in the database, so that end users can easily give/take permissions to/from others in the admin panel. How can I implement this? If you want to take control of the authorization process, you should subclass AuthorizeAttribute and override the AuthorizeCore method. Then simply decorate your controllers with your CmsAuthorizeAttribute

Using action parameters in custom Authorization Attribute in ASP.NET MVC3

谁都会走 提交于 2019-11-28 18:45:49
I have a controller which should only request authorization when loaded with specific parameters. Like when the parameter ID is 8 for example. I came up with using a custom validation attribute like this: public class MyAuthorizeAttribute : AuthorizeAttribute { protected override bool AuthorizeCore(HttpContextBase httpContext) { if (/* Action's inputparameter ID = 8 */) { return base.AuthorizeCore(httpContext); } return true; } } My action looks like this (not that it is interesting) [MyAuthorize] public ActionResult Protected(int id) { /* custom logic for setting the viewmodel from the id

Overriding AuthorizeCore in custom Authorize attribute results in “no suitable method found to override” error

◇◆丶佛笑我妖孽 提交于 2019-11-28 18:39:44
I'm trying to build custom AuthorizeAttribute, so in my Core project (a class library) I have this code: using System; using System.Web; using System.Web.Mvc; using IVC.Core.Web; using System.Linq; namespace IVC.Core.Attributes { public class TimeShareAuthorizeAttribute : AuthorizeAttribute { protected override bool AuthorizeCore(HttpContextBase httpContext) { if(!httpContext.Request.IsAuthenticated) return false; var rolesProvider = System.Web.Security.Roles.Providers["TimeShareRoleProvider"]; string[] roles = rolesProvider.GetRolesForUser(httpContext.User.Identity.Name); if(roles.Contains

Granting access to IIS 7.5 ApplicationPoolIdentity [duplicate]

无人久伴 提交于 2019-11-28 18:30:58
问题 This question already has an answer here: IIS7 Permissions Overview - ApplicationPoolIdentity 8 answers When I try to access my ASP.NET MVC application I get the error: Access to the path 'C:\inetpub\wwwroot\website\bin\test.Platform.Config.xml' is denied I run IIS 7.5 with an application pool that has the property: Identity: ApplicationPoolIdentity I imagine it is because the 'ApplicationPoolIdentity' cannot read the file I try to access. So my question is: Since the 'ApplicationPoolIdentity

Authorizing command line tool to consume Google APIs (through OAuth2.0 or anything else)

我只是一个虾纸丫 提交于 2019-11-28 18:18:18
I think I understand how OAuth 2.0 works in the context of a mobile app or website - neither is my case. I have a C++ command line application that I want to give access to one of the Google Services ( Google Fusion Tables ) but I think this question applies to any of the Google Services, or heck, perhaps also any command line app that has to deal with OAuth2. I have the username. I have the password (the user typed it). I need to get a token so I can make the calls through Curl. What is the easiest way to accomplish this? Update 1: After going through the documentation, it seems that the

Issuing “API keys” using Keycloak

廉价感情. 提交于 2019-11-28 18:03:46
My setup has three components: A backend application (Python/Flask) A frontend application (VueJS) Keycloak The frontend will use Keycloak to let users sign in and use the access tokens to authenticate requests to the backend. So far so good. Now I want third party applications to be able to make authenticated requests against the backend and I am wondering how that can be realized using Keycloak? My idea is to issue a new set of credentials for each customer. Their application then talks to Keycloak to get access tokens. I can then use Keycloak to manage access control for all users of the

Pyramid authorization for stored items

烂漫一生 提交于 2019-11-28 17:56:52
I'm trying to create an authorization policy that takes "item" ownership into account. For example some user X "owns" items A, B, C. Those are accessed via URLs like /item/{item}/some_options . How can I get the information about {item} to the authorization policy object (permits() call)? Is putting additional information into context a good idea (I'm doing routes-based routing only). How would I do that? You can do this using the ACLAuthorizationPolicy combined with URL Dispatch by using a custom resource tree designed for this purpose. For example, you have permissions for Foo objects, and