authorization

ASP.NET Web API Authorization tokens expiring early

旧时模样 提交于 2019-11-27 14:26:42
I have implemented security for my web api (individual accounts) as discussed here . I have hosted the website on godaddy (shared hosting) and its working fine. When I ask for token by using url "domain.com/token", I get the token with expiration date of within 15 days. I have set this in "StartupAuth.cs" using AccessTokenExpireTimeSpan = TimeSpan.FromDays(15) e.g.: { "access_token":"qwertyuiop.....", "token_type":"bearer", "expires_in":1209599, "userName":"user@example.com", ".issued":"Wed, 11 Feb 2015 01:00:00 GMT", ".expires":"Thu, 26 Feb 2015 01:00:00 GMT" } (I put values in above code,

Custom user authorization based with roles in asp.net mvc

此生再无相见时 提交于 2019-11-27 14:11:22
问题 I have created a custom authentication and authorisation for my users.The problem I am facing is how to get mvc to check that role from inside my users table matches the [Authorize(Role)] on my controller so as to set httpauthorised to true.Below is my customauthorise class. [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = true)] public class CustomAuthorizeAttribute : AuthorizeAttribute { public override void OnAuthorization

How to protect RESTful API

北慕城南 提交于 2019-11-27 13:56:09
问题 I have been looking for a way to protect my RESTful APIs. This appeared simple, but it seems to not be so simple. First off, I am writing an iOS app connecting to a Play Framework server. None of this has anything to do with Google, Facebook, Twitter, or LinkedIn (shocking I know). Oh, and my current plans do not require custom apps to use my APIs, its just my apps for the time being. Basic Authentication What appeared to be simple was a basic user/pass on a /auth method managing a cookie

How to configure user and password for neo4j cluster without REST API

回眸只為那壹抹淺笑 提交于 2019-11-27 13:41:25
问题 The version I use is neo4j-enterprise-2.2.0-M02 My question is : How can I configure a user (like add a new user, change the password ,etc) in backend or browser, instead of REST API? Can I do it via neo4j-shell? imagine that I am a DBA, it is not very convenient to do this by REST API. Any help will be greatly appreciated! 回答1: You can use the browser instead of the API. Just go to http://localhost:7474 (or whatever IP to which the web console is bound) and you will be prompted to change the

What options are available to accept credit card payments through an iPhone? [closed]

倖福魔咒の 提交于 2019-11-27 13:32:09
问题 What are the options to accept a credit card payment from an iPhone application? This will be a stand alone application, not an iPhone specific web site. Can I integrate with a payment gateway like Authorize.net? What about paypal or Google checkout? I know on some web sites, it will take you to a paypal site for the payment authorization - can this be done over http requests, instead of forcing the user to another website (which won't be available from the app)? Are there any security

In a nutshell what's the difference from using OAuth2 request getAuthToken and getToken

依然范特西╮ 提交于 2019-11-27 13:21:40
When deling with access token OAuth 2.0 In a nutshell what's the difference from using: AccountManager.getAuthToken ("oauth2:https...userinfo.profile") , and using Google Plays: GoogleAuthUtil.getToken(mActivity, mEmail, mScope) As I understand it they both produce a challenge screen for the user, the Google Plays screen is user friendlier. The access token can have same scope right?! Both call have to be asynchronously. InvalidateToken looks like it has to be checked for in both calls, and more? nibarius I didn't know about using Google Play services for OAuth 2.0 authentication, but after

Obtaining admin privileges to delete files using rm from a Cocoa app

末鹿安然 提交于 2019-11-27 12:30:51
问题 I am making a small app that deletes log files. I am using an NSTask instance which runs rm and srm (secure rm) to delete files. I want to be able to delete files in: /Library/Logs ~/Library/Logs The issue is that the user account does not have permissions to access some files in the system library folder, such as the Adobe logs subfolder and others. For example, only the "system" user (group?) has r/w permissions for the Adobe logs folder and its contents, and the current user doesn't even

django: User Registration with error: no such table: auth_user

给你一囗甜甜゛ 提交于 2019-11-27 12:00:59
问题 I try to use Django's default Auth to handle register and login. And I think the procedure is pretty standard, but mine is with sth wrong. my setting.py: INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'books', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf

WCF - Windows authentication - Security settings require Anonymous

主宰稳场 提交于 2019-11-27 11:54:37
问题 I am struggling hard with getting WCF service running on IIS on our server. After deployment I end up with an error message: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. I want to use Windows authentication and thus I have Anonymous access disabled. Also note that there is aspNetCompatibilityEnabled (if that makes any difference). Here's my web.config: <system.serviceModel>

MVC role-based routing

ぃ、小莉子 提交于 2019-11-27 11:50:38
I have a project with 2 areas /Admin and /User. Admin's default route is /Admin/Home/Index and user's default route is /User/Home/Index . Is it possible to implement routing to make their home URL to look like /Profile/Index but to show content from /Admin/Home/Index for admins and /User/Home/Index for users? upd Finally find out how to do it context.MapRoute( "Admin", "Profile/{action}", new { area = AreaName, controller = "Home", action = "Index" }, new { RoleConstraint = new Core.RoleConstraint() }, new[] { "MvcApplication1.Areas.Admin.Controllers" } ); ... context.MapRoute( "User",