authorization

Building CustomAuthorization in ASP.NET MVC

瘦欲@ 提交于 2019-12-06 17:41:44
问题 In the DB i have Role and User entities with one to many relationship. What i am trying to do is to build custom authorization filter. All the tutorials that i have seen are using default ASP.NET membership. All i know is that i need to inherit AuthorizationAttribute but do not know which methods do i need to override and how to implement them. public class UserAuth : AuthorizeAttribute { } In the DB : Role public class Role { [Key] public int RoleID { get; set; } [Required] public int

ASP.NET Authorization from Console Application & Timeout

我的梦境 提交于 2019-12-06 17:07:47
问题 For what its worth, I managed to get a console application to authenticate itself with an existing ASP.NET web application. It just mimics the login page by making a post request to the login page containing the viewstate information (just as if a browser had made the request). It then catches the cookie sent back in response in a CookieContainer. The application then goes on to make multiple requests to the same page (which requires authorization). The page does some work and writes out a

Should authorization logic be centralized or decentralized?

眉间皱痕 提交于 2019-12-06 16:22:06
We have an SSO system for authenticating users. We have a debate between these 2 options: Should we centralize the authorization of each application to one database (or any other single solution) and retrieve the information within the SSO request Each web application client should manage it's own authorization logic in it's a local database / scheme. You should strive to decouple your business logic from non functional requirements such as authentication, logging, and of course authorization. You already implemented SSO and surely you use a user directory as the backend for the SSO to store

Password Hashing for SSO between Wordpress and CakePHP

匆匆过客 提交于 2019-12-06 15:56:38
We have a Wordpress site which we are going to gradually rebuild using the cakePHP framework. We will replace different parts of the Wordpress site incrementally, so we need to implement some sort of single sign on to allow authorization across both frameworks during the time while both frameworks are running side by side. We have a pretty good strategy for how to do this. In short, we will duplicate all user rows in two different tables: one table for Wordpress ( wp_users ) and a different table for Cake ( users ). [More details outlined here (in case you're interested).] This means when we

asmx web service authorization

人盡茶涼 提交于 2019-12-06 15:19:58
I have asmx web service(c#). I'm using Windows Authentication to access web service. Now i need to provide some of web service methods only for speciefic user, for example Test. I cant find examples of such Authorization. Some examples of code would be appreciated. I don't think that web service have such restriction per memeber. Probably you will need to check the user rights inside of the web service members [WebMethod] public void HelloWorld() { if (this.DoesUserHaveRights(HttpContext.Current.User)) { // do the work here } else throw new AuthenticationException(); } or somethign like this

SLIM Framework - How to make an Access Control List with SLIM?

旧时模样 提交于 2019-12-06 14:35:17
问题 An Access Control List, or ACL, defines the set of rules that determines which group of users have access to which routes within your Slim application. Any idea how to use Access Control List with SLIM ? I try to create Access Control List for my REST API Authorization. Example : Role member only can access GET,UPDATE from resource (/member) Admin member only can access GET,UPDATE,POST,DELETE from resource (/admin) Any idea how to do it with SLIM ? 回答1: Still learning but... In my Slim routes

Okta Group Attributes

两盒软妹~` 提交于 2019-12-06 14:23:05
问题 I have two service providers that I am connecting to Okta in order to manage identities externally. Can you think of a way to configure Okta to accomplish the following: Associate attributes with groups, rather than directly to users. Users within groups would then inherit these attributes. Associate groups with applications, rather than directly associating users with applications. My end goal is to be able to leverage Okta for managing a role store for each service provider. I would expect

show different content based on logged in user django

时光总嘲笑我的痴心妄想 提交于 2019-12-06 13:44:54
问题 So I just learned Python/Django last weekend. What I'm trying to do is have url routes available with different content depending on who's logged in. So my usecase is I create 5 usernames/passwords and then those 5 users can login to read specific content/routes catered to them that no other user should be able to see. Right now I have these routes with correlating views. urlpatterns = [ url(r'^$', accounts.views.loginview), url(r'^accounts/', include('accounts.urls')), url(r'^sitepages/',

How to do ASP.NET Web API integration tests with custom authentication and in-memory hosting

时间秒杀一切 提交于 2019-12-06 13:38:42
A similar question has been answered here but the answer doesn't seem to work in my case. I want to test the authentication/authorization process in my Web Api which is using a JWT authentication. My authentication is handled through a custom MessageHandler that I add to my HttpConfiguration . Authorization in handled by a simple [Authorize] Attribute on Controller/Methods I want to restrict access to. I'm setting the principal I've extracted from my token this way during authentication (in my custom MessageHandler ): Thread.CurrentPrincipal = principal; if (HttpContext.Current != null) {

Having trouble with authentication in asp.net web application

自古美人都是妖i 提交于 2019-12-06 11:32:32
I am trying to authenticate users who are logging into my web application from a log-in page. I was using this tutorial as a guide, which pretty much explained exactly what I'm hoping to do, but when I enter in the username and password, the validation is not working. Allow me to explain. Here are relevant parts of my HTML. Nothing out of the ordinary: <form id="form1" runat="server"> <div class=row> <div class=col-xs-4> <div class="form-group"> <input id="txtUserName" type="text" runat="server"> <ASP:RequiredFieldValidator ControlToValidate="txtUserName" Display="Static" ErrorMessage="*"