authorization

Rails Devise Legacy Users from CakePHP

不打扰是莪最后的温柔 提交于 2019-12-11 00:22:39
问题 I recently got Devise working. New users sign in, sign up, logout etc etc just fine. Old users however have an issue. I have gotten it to a point where I get a 401 unauthorized, which seems to me that the hash is just incorrectly being created when signing in and of course not matching correctly. My user model: class User < ActiveRecord::Base require "digest/sha1" # Include default devise modules. Others available are: # :token_authenticatable, :encryptable, :confirmable, :lockable,

Wolkenkit: ACLs for authorization and user roles

心已入冬 提交于 2019-12-11 00:15:44
问题 I am trying to understand on how to extend the wolkenkit auth layer. Say i want users with different roles: normal, moderator and admin. normal users can see and modify their own content, but aren't allowed to modify content from other users. moderator users are allowed to modify all entries, but don't have permission to delete anything than their own content. admin users can modify and delete everything. There are also unauthenticated guest users who can read everything but modify nothing.

Placing authorization into the service layer rather than Web API layer

依然范特西╮ 提交于 2019-12-10 23:37:30
问题 I'm building out a REST API with .NET Core Web API. My controllers simply forward requests to the service layer and return the result [HttpPost(nameof(Create))] public async Task<Response<ProviderDTO>> Create([FromBody] ProviderDTO provider) => await providerService.CreateAsync(provider); I'm at the point in the system now where I need to start implementing authorization. .NET Core has a lot of options to implement authorization, but the documentation predominantly discusses these approaches

Authorizing non-logged-in user behavior in rails with cancan and devise

非 Y 不嫁゛ 提交于 2019-12-10 23:33:33
问题 Post: hidden: boolean I want the logged in user could see all the posts, and the non-logged-in user only have access to posts whose hidden fields are false. So I write like this in cancan's Ability Model: if user_signed_in? can :read, Post else can :read, Post, :hidden => false end but accessing the helper user_signed_in is not allowed in Model. As stated in this question: Rails 3 devise, current_user is not accessible in a Model ?. While we could using some tricks to access the helper, its

authentication against ADFS, authorization against sql server

回眸只為那壹抹淺笑 提交于 2019-12-10 23:00:39
问题 after several days of searching, reading and trial and error i definitely need some help. The Situation : I need to create a Web-Application using MVC where users are authenticated against an AD using ADFS. But they do not want to store the Roles and further Informations into the AD. So i need to read and store those informations somewhere else. My first thougt was to use the same infrastructure which VS sets up when i created a new Web-Application and choose "Individual User Accounts". What

How to authorize root to run gsutil?

好久不见. 提交于 2019-12-10 22:37:45
问题 backup_to_gcs.sh is a backup script that uses gsutil rsync to copy files to Google Cloud Storage. The backup script runs when called by user wolfv (who installed the google-cloud-sdk): $ /home/wolfv/scripts/backup_to_gcs/backup_to_gcs.sh backup_to_gcs.sh in progress ... backup_to_gcs.sh pass So far so good. But root needs to run gsutil so that the backup script can be called from Anacron. So lets have root run the script. It's safe for root and wolfv to share credentials because it's the same

To call this method, the “Membership.Provider” property must be an instance of “ExtendedMembershipProvider”

梦想与她 提交于 2019-12-10 21:18:38
问题 I'm running into this error and I can't quite figure it out. I'm posting data to my controller via PostMan in Chrome, reaching the CreateUserAndAccount method, and receiving this error: To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider". Here is my controller: [System.Web.Http.Authorize] [InitializeSimpleMembership] public class AccountController : ApiController { // POST: /api/register [System.Web.Http.HttpPost] [System.Web.Http

Google App Script One Shot Authentication

↘锁芯ラ 提交于 2019-12-10 20:13:57
问题 I'm trying to make my Google App Script/Google Spreadsheet a template. The only problem I'm having is with authentication. If you try to run any of the script it will authenticate itself but I need it to deploy itself as a WebApp. I'm using: function startWebApp() { //Setup the webapp service var service = ScriptApp.getService(); service.enable(service.Restriction.ALL); Logger.log("WebApp Started"); } and when I run this from a menu I've created in the spreadsheet, so it has a nice front-end

What are scope values for an OAuth2 server?

为君一笑 提交于 2019-12-10 20:09:01
问题 I'm facing a difficulty to understand how scopes work. I found here a small text that describes the scopes of stackexchange api but i need more information on how they work (not specifically this one...). Can someone provide me a concept? Thanks in advance 回答1: To authorize an app you need to call a URL for the OAuth2 authorization process. This URL is "living" in the API's provider documentation. For example Google has this url: https://accounts.google.com/o/auth2/auth Also you will need to

Restrict Office365 App “Read mail in All mailboxes” permission to specific mailbox

泪湿孤枕 提交于 2019-12-10 18:58:00
问题 I'm trying to download emails through Office365 app in MVC web app. And I'm struggling with configuring app permissions on Azure Active directory. Permission says: "Read mail in All mailboxes" however I want to choose which mailboxes it can access/read. Does anyone know ho to be more specific in setting up permissions in AAD? Thanks for any help. string authority = "https://login.microsoftonline.com/" + SettingsHelper.TenantId + "/oauth2/token"; var credential = new ClientCredential