authorization

What is the best way to implement Users & Roles Authorization and Authentication in MVC 3

那年仲夏 提交于 2019-12-11 10:34:03
问题 I am looking to see what is the best way to implement asp.net membership in an MVC 3 project. One thing to note is that I have a separate users table and would like to still use this. So can I link my users table to the asp.net memberships table? Cheers, Noel. 回答1: Description You can implement your own MembershipProvider. Then you have full control about how authentification works and wich database / tables are relevant. I think you dont need the default asp.net membership database. More

activemq User is not authorized to create: topic://ActiveMQ.Advisory.Connection

故事扮演 提交于 2019-12-11 10:18:52
问题 I am trying to use authorization in activemq, but stuck for some time now. Here is my java code, everything works fine when I remove the authorization plugin. I am trying to create a topic named "room2". Context jndiContext = new InitialContext(); ConnectionFactory connectionFactory; connectionFactory = (ConnectionFactory) jndiContext .lookup("ConnectionFactory"); connection = connectionFactory.createConnection("system", "manager"); session = connection.createSession(false, Session.AUTO

Using Authorization Services with NSTask

半城伤御伤魂 提交于 2019-12-11 10:08:13
问题 Ok, I am using NSTask to run a shell script that needs to be run with administrator privileges. I am using some code from this question: NSTask and AuthorizationCreate. Here is what I currently have: //Authorization Create AuthorizationRef myAuthorizationRef; OSStatus myStatus; myStatus = AuthorizationCreate (NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed , &myAuthorizationRef); AuthorizationItem myItems[1]; myItems[0].name = "com

Custom Authorization Filter in .NET Core API

落爺英雄遲暮 提交于 2019-12-11 10:06:52
问题 I want to authorize users before accessing any data using my core api, so I tried is using JWT authentication. I have successfully generated token while signing in user using api and saved that token on client side in session, now whenever user wants to access any data using api, I'll send that token in header to api and I want to validate that JWT token using custom authorization filter. I have created custom authorization filter and applied it on my GetMenu api and I'm able to validate that

ASP.NET web.config authorization settings ignored

主宰稳场 提交于 2019-12-11 09:11:21
问题 I have an asp.net (dynamic data) website set up as an application in a subdirectory of another site. This site requires different security settings from the top level site. Something like: <authorization> <allow roles="ADMIN"/> <deny users="*"/> </authorization> These settings are ignored in the sub site. However, they work on the top level site, but even when set on the top level site, they are not inherited by the sub-site, and it's freely accessible. What could cause these settings to be

Windows Azure basic authentication doesn't work in the cloud?

我只是一个虾纸丫 提交于 2019-12-11 08:27:44
问题 I'm building a service, using soap (wcf). I want to make my endpoint a bit more secure with a single password and username. When i try to add following configuration, Windows Azure throws the following error: Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false". Linecode

How do I add a Bearer Token to the header of a HTTP request?

≯℡__Kan透↙ 提交于 2019-12-11 07:47:51
问题 I am having trouble figuring out how to set authorization headers with authorization as the key and a bearer token as the value. I have completed a web API with authentication built into it. i have tested it on postman and it all works. the problem is on post man i take the token copy past it to a new key and value, in the site i am not sure how to change those values in a Blazor project. When entering a Get to the API at http://testapi.com/api/token/{username}/{password} the API sends back a

.NET MVC Authorization Attribute throwing SQL network related exception

痞子三分冷 提交于 2019-12-11 07:07:15
问题 I have defined an authorization attribute like following: public override void OnAuthorization(AuthorizationContext filterContext) { base.OnAuthorization(filterContext); if (!filterContext.HttpContext.User.Identity.IsAuthenticated) { filterContext.Result = new RedirectResult("~/Login"); return; } var requiredRoles = Roles.Split(Convert.ToChar(",")).ToList(); var roles = ((ClaimsIdentity)filterContext.HttpContext.User.Identity).Claims .Where(c => c.Type == ClaimTypes.Role) .Select(c => c.Value

Automatically retry on 401 and send specific request with HttpClient 4.3

。_饼干妹妹 提交于 2019-12-11 06:59:37
问题 I use specific auth mechanism in the app. To login app sends login request to specific url /login/ and gets back session token that is stored in cookie. At any time token can be invalidated by server and other requests will result in 401. I want HttpClient to detect 401 error automatically, redo /login/ request once and retry original request automatically. I've tried setting HttpRequestRetryHandler in HttpClients.custom().setRetryHandler but it seems it does not handle 401 errors. What would

Where should the authorization logic go in an api based application?

耗尽温柔 提交于 2019-12-11 06:57:57
问题 I have a brand new Rails api based application, where i need to implement authorization. Overall Architecture: React frontend -> Rails API layer -> Rails model/server layer While exploring different approaches, I have got a confusion. Should we put the authorization logic in API layer or Service layer? API Layer Approach: We will build some authorization middleware that will sit between our front end and API layer and all our api calls will be routed thorough the authorization middleware to