authorization

MVC: creating a custom [AuthorizeAttribute] which takes parameters?

被刻印的时光 ゝ 提交于 2019-12-02 09:24:00
Here is my problem: I'm authorizing users on their roles, for 1 part. [Authorize(Roles = "Admin,...")] public class ModulesController : Controller { ..... } the Modules controller shows a list of modules which the user has right to. (there are a LOT of modules, but the user is only connected to a part of them). there are a load of things coupled to the modules, like questions, ... for example: the details view of the Modules controller. public ActionResult Details(int id) { var mod = (from p in _db.Modules where p.Mod_ID == id select p).First(); return accessible(mod); } [NonAction] public

Gmail Api return Unauthorized client or scope in request

荒凉一梦 提交于 2019-12-02 08:44:14
I have struggled to make this work but did half the job. Actually I can only read messages from Gmail API, If I try to use the gmail.modify Scope I get an error: HttpAccessTokenRefreshError: unauthorized_client: Unauthorized client or scope in request. Here is my code: # init gmail api credentials_path = os.path.join(settings.PROJECT_DIR, 'settings/gmail_credential.json') scopes = ['https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.modify'] credentials = ServiceAccountCredentials.from_json_keyfile_name(credentials_path, scopes=scopes) delegated_credentials

SoapHttpClientProtocol.ReadResponse - The request failed with HTTP status 401: Unauthorized

走远了吗. 提交于 2019-12-02 08:00:53
I have an ASP.NET (v2.0) web application that uses a reference to a SQL Server Reporting Services 208 R2 instance (using the ReportService2010.asmx service endpoint). The web application is hosted on ServerA and the Reporting Services instance is hosted on ServerB. ServerA is running Windows Server 2003 (IIS6) and ServerB is running Windows Server 2008 R2. The web application is configured to use Windows Authentication and impersonation is switched on. When I run the web application locally on ServerA (using a remote desktop connection) it works, but when I run from my desktop machine (Windows

Securing the Raven Database

我的梦境 提交于 2019-12-02 07:59:36
I'm trying to restrict access to our RavenDB to only one user. After altering the settings to secure the DB, I can still access the RavenDB management studio and I'm not sure why. I'm running RavenDB as a windows service, and I'm using build 573. This is my Raven.Server.exe.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Raven/Port" value="*"/> <add key="Raven/DataDir" value="~\Data"/> <add key="Raven/AnonymousAccess" value="None"/> <!-- Settings are Get, All, None --> <add key="Raven/Authorization/Windows/RequiredUsers" value="FS-6103\PrestoDatabaseUser

How to assign dynamically components/fields permissions to certain roles in Angular?

半腔热情 提交于 2019-12-02 07:37:14
问题 I am working on an Angular 7 project and developing a role/permission management dashboard where a super-admin can assign and manage rolesx and their permissions respectively by clicking the check boxes. What I was specifically tasked to do is implement something similar to what is implemented in VtigerCRM So when the super user assigns permission, the user should be assigned access to that particular component and/or that particular field in the component. I'm wondering is there a way to

Spring security custom FilterInvocationSecurityMetadataSource implementation 403 forbidden issue

流过昼夜 提交于 2019-12-02 07:21:30
问题 To make things short I'm trying to implement a custom FilterInvocationSecurityMetadataSource in order to secure/authorize certain parts/URL endpoints dynamically in my web app using spring security 5.0.6 and Spring Boot 2.0.3. The issue is that no matter what Role I use it always gives me the forbidden page. I have tried several things with different role names and (believe me) I have searched the whole internet even on spring security 5.0.6 books but nothing seems to work. This issue may be

JWT Authorization header not reaching api

僤鯓⒐⒋嵵緔 提交于 2019-12-02 07:17:20
问题 I deployed my laravel project on a shared hosting server that supports mod_rewrite and want to send a header called Authorization (JWT header) but it wont reach the controller. mt .htaccess: Options -MultiViews -Indexes RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^

Using XACML to express policy which is a logical expression

和自甴很熟 提交于 2019-12-02 06:53:28
I am very new to XACML. And I am using XACML to express policy. But I can't find any good examples except a few from the OASIS XACML Technical Committee . Ok, here is my question: I want to express policy using XACML. Users can access to the resources only if they satisfy the policy. The policy is an logical expression. For example: (not A1) and (A2 OR A3) and (2 of (A4, A5,A6)) 2 of (A4,A5,A6) refers that it is true only if 2 or more of A4,A5,A6 is true. "AllOf" and "AnyOf" can be used to express "AND" and "OR", but I don't know how to express "2 of (A4,A5,A6)" and "not A1". Thank you! Based

How to manage Azure AD App Roles for Azure AD Users

天大地大妈咪最大 提交于 2019-12-02 06:12:39
问题 1: Is anyone aware of a tool that can manage the assignment of Roles for Azure AD Users (the appRoles defined in the manifest) for Enterprise Applications in Azure AD? I am talking about how to Assign Roles (app specific) to existing Azure AD Users. It’s a very slow process using the Azure Portal for this. Of course, we could create this tool, but would be nice if such a tool already exists. What are large organizations with many Azure AD Enterprise Apps using today? 2: Is it really best

Authlogic: getting an undefined method `password' for #<User:

怎甘沉沦 提交于 2019-12-02 05:51:25
问题 I can't seem to get my User model in Authlogic to understand the 'password' method even though I added "acts_as_authentic" to the model. This problem was also reported on the Authlogic lighthouse, but no one described how they fixed it: http://binarylogic.lighthouseapp.com/projects/18752/tickets/128-undefined-method-password-on-rails-231#ticket-128-9 The user table exists with all the required fields, and the controllers and everything else is definitely following the tutorial to the letter.