authorization

Dynamically managing web.config for authorization?

倾然丶 夕夏残阳落幕 提交于 2019-12-25 10:03:19
问题 I'm using a CMS (N2) to manage a new website. The CMS includes functionality for uploading files using the filesystem (not binary in DB, which is also possible, but I want to use filesystem). Some of the subfolders in the uploads directory need to be secured. This can be done using authorization elements in (a sub) web.config as stated here. Users and roles are managed through the admin interface and are managed by my CMS administrator. Some roles are added dynamically based on certain

asp.net authorization - deny all before login except the register page

会有一股神秘感。 提交于 2019-12-25 05:37:07
问题 I'm using ASP.NET Authorization to deny users access to my site before logging in, but this is also blocking the Register.cshtml page. How do I sort out my authorizations to allow this page through? <system.web> <authorization> <deny users="?" /> </authorization> </system.web> <location path="Content"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="Register.cshtml"> <system.web> <authorization> <allow users="*" /> </authorization> <

Authorization and Authentication using WCF

寵の児 提交于 2019-12-25 04:33:37
问题 What are the best practices for handling security i.e. Authorization and Authentication in Web Application? I am working on a web application, using WCF as SOA, there are more chances that in future individual component in my application can be integrated with some third party application. I am looking for a solution by which I can handle Authorization and Authentication for my application using internal approach of my application as well as i can use interface provided by some third party

Modify SCPreferences persistent storage: Invalid Argument

守給你的承諾、 提交于 2019-12-25 02:24:46
问题 Currently trying to modify /Library/Preferences/com.apple.Bluetooth.plist in order to programmatically remove Bluetooth devices and running into an error. First of all, when SCPreferencesSetValue is called, System Configuration says Error Domain=com.apple.SystemConfiguration Code=0 "Success!" UserInfo={NSDescription=Success!} However, when I try to SCPreferencesCommitChanges , the framework tells me Error Domain=com.apple.SystemConfiguration Code=1002 "Invalid argument" UserInfo=

C# Web API - Security for some of the GET requests

荒凉一梦 提交于 2019-12-25 02:19:22
问题 On an existing host I've added Web API Models & Controllers. I've added the following four: Products Orders Categories Users When someone accesses the localhost:port\api\products , it returns all the products in JSON format. The Create, Update and Delete statements are completely disabled, so we are only able to use GET-requests on the API (so either \api\products for a list of all products or api\products\# for a single products with id #). Because the other CRUD's aren't used, there isn't a

Authorization and authentication on the web application with JSF, Hibernate and Tomcat

纵饮孤独 提交于 2019-12-25 02:00:24
问题 I am programming a Web-Application with Java EE, JSF, Hibernate, MySQL by using Eclipse and Apache Tomcat. I do not use Spring, EJB or etc. I have simple login page. There are two inputs for username and password and submit button to pass values of inputs to the bean. If entries of users are matched with records in DB, then next page is opened. However, this process has a lack of security. If user enters a URL of next pages, he/she can easily skips login process without any security. I know

How to create a custom Authorize attribute for multiple policies in ASP.NET CORE

南楼画角 提交于 2019-12-25 00:45:26
问题 I want to authorize an action controller could access by multiple policies. .e.g: [Authorize([Policies.ManageAllCalculationPolicy,Policies.ManageAllPriceListPolicy]] public async Task<IActionResult> Get(int id){} Thank a lot. 回答1: For multiple policys, you could implement your own AuthorizeAttribute. AuthorizeMultiplePolicyAttribute public class AuthorizeMultiplePolicyAttribute:TypeFilterAttribute { public AuthorizeMultiplePolicyAttribute(string policies,bool IsAll):base(typeof

The request is missing a valid API key

三世轮回 提交于 2019-12-25 00:21:51
问题 I am trying to use the Google Sheets API . The problem is, once I call my script function on the google spreadsheet, I get the following error: API call to sheets.spreadsheets.values.get failed with error: The request is missing a valid API key. (line 5). where line 5 in the script looks like this: var values = Sheets.Spreadsheets.Values.get(spreadsheetId, rangeName).values; and spreadsheetId and rangeName are defined in the first lines. I think the problem might be that I did not copy the

How to add authorization to RazorPages?

回眸只為那壹抹淺笑 提交于 2019-12-24 23:13:55
问题 I have looked at the current official Microsoft Docs and was unable to find anything properly covering how to handle authorization for RazorPages. I figured out that you can add the AuthorizeAttribute to the PageModel like so: // using Microsoft.AspNetCore.Authorization [Authorize] public class IndexModel : PageModel { ... } I don't want to repeat this for every page. Is there a better way? 回答1: You can configure authorization under the ConfigureServices method. Here is an example : services

Has there been a change to the way asp.net authorization / authentication deals with non asp.net files?

删除回忆录丶 提交于 2019-12-24 22:56:46
问题 Whenever I've worked with asp.net authentication / authorization in the past, I can remember that it never used to secure .htm .js .css files (actually, any file that isn't processed by asp.net isapi dll). After a while of doing other work I've now come back to doing some web development, this time using VS2010 and now the opposite is true. It appears as if all files are secured because the images and .js files on my login page aren't working. My question is, was my initial assumption about