authorization

Single Sign On (SSO) between Wordpress and CakePHP

坚强是说给别人听的谎言 提交于 2019-11-29 03:05:32
问题 I have an existing Wordpress site. The plan is to rebuild the site using the cakePHP framework. Due to time restrictions, I want to replace individual sections of the Wordpress site one at a time. This will mean that both apps will be running side by side for a certain period of time. I need to control access to the cakePHP app using the authorization provided by Wordpress. I'm not sure the best way to go about doing this. I've seen similar questions asked a lot, but I have not yet found a

ASP.NET MVC - CustomeAuthorize filter action using an external website for loggin in the user

此生再无相见时 提交于 2019-11-29 02:20:01
I have a CustomeAuthorize action filter that forwards the user to signin page if user is not authenticated. I apply this filter to actions or controllers. [CustumeAuthorize] public ActionResult MyAction() { //do something here return View(); } and the filter looks like this: public class CustomAuthorizeAttribute : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { if (!currentUserIsAuthenticated) { filterContext.Result = new RedirectToRouteResult( new RouteValueDictionary{{ "controller", "Account" }, { "action", "SignIn" }, { "returnUrl",

What is the best mechanism to implement granular security (i.e. authorization) in an ASP.NET MVC application?

会有一股神秘感。 提交于 2019-11-29 01:52:41
Suppose a high-speed developer was tasked with building a banking application which would be accessed by many different people. Each person would want to access his or her own account information but would not want others to access it. I would like to know the best practice for restricting access in an MVC application so that only the user who owns the information (or an administrator) could access it. The Authorize attribute allows us to restrict by role. While this is a starting point, it seems that any authenticated user could gain access to any other user's information. ActionFilters seem

Rails: admin-only maintenance mode

十年热恋 提交于 2019-11-29 01:37:04
问题 I'd like to put my app into maintenance mode but still have admins / moderators be able to log in and use the site. Two reasons: I'm making some changes within the app that are best applied using the in-app interface rather than the console. Moderators don't have access to the console, but can definitely help with the maintenance tasks we have ahead of us. How would you recommend this be done? I have been experimenting with setting an environment variable ADMIN_MODE and changing all the

ASP.NET IAuthorizationFilter OnAuthorization

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 01:33:17
Hi I am trying to implement a custom Authorization filter //The Authourization attribute on a controller public class CustomAdminAuthorizationFilter : IAuthorizationFilter { private readonly IAuthentication _authentication; public SageAdminAuthorizationFilter(IAuthentication authentication) { _authentication = authentication; } public void OnAuthorization(AuthorizationContext filterContext) { bool result = _authentication.Authorize(filterContext.HttpContext); } } As you can see on the OnAuthorization I get back a result that is true of false. What do I need to set to return where I came from?

MVC 3 AuthorizeAttribute Redirect with Custom Message

不想你离开。 提交于 2019-11-29 01:28:54
How can I create a custom AuthorizeAttribute that specifies a message in the form of a string parameter and then passes that along to the login page? For example, ideally it would be cool to do this: [Authorize(Message = "Access to the blah blah function requires login. Please login or create an account")] public ActionResult SomeAction() { return View(); } Then, in the Login action, I could do something like this: public ActionResult Login(string message = "") { ViewData.Message = message; return View(); } And finally in the view I can do this: @if (!String.IsNullOrEmpty(ViewData.Message)) {

How to Redirect Users to an ASP.NET page when not Authorized?

廉价感情. 提交于 2019-11-29 00:45:40
问题 I need my users are redirected to AuthError.aspx page ("You don't have the access to this page") in the case when they are authenticated but try to access the page that they cannot access (because of the role for exam). If I set up web.config so: <authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> </authentication> this is the system's wrong behaviour because an user is already authenticated and there is no need to redirect him or her to this page. But if I

TYPO3: 404 for restricted access page instead of login form

会有一股神秘感。 提交于 2019-11-28 23:50:00
I have a link pointing to restricted page. When I access the link directly in logout status, its redirect to 404. Actually it should redirect to login form. I tried: config { typolinkLinkAccessRestrictedPages=PAGE_ID typolinkLinkAccessRestrictedPages_addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID### } Not working. Also I tried the login status redirect plugin, no use. Anyone know how to do this? I am using TYPO3 version 4.4.8. Mateng As this is still unanswered, does this help? # Check if user is logged in: [usergroup = *] # do something [else] page.config > page.config

Using OAuth for server-to-server authentication?

南楼画角 提交于 2019-11-28 23:06:47
I'm currently working to specify my company's new partner/public API, which will be a resource-oriented RESTful web service. The missing piece of the puzzle at the moment is authentication/authorization. The requirements are: Initially it must work for a server-to-server environment, e.g. a server application must be able to identify itself so that we know who is calling the API. In future, we would like to allow it to impersonate user accounts, so as well as the server being identified it would have a token that represents a user account for a limited period of time. OAuth seems to be ideal

How to authorize mobile apps with a third party by oauth BUT connect to my service, not the 3rd party

好久不见. 提交于 2019-11-28 22:46:34
问题 My app is architected as follows: I have a web service (running on GAE, not very relevant to this question) and the data that this service contains is made available through a website and through mobile and desktop apps. Currently, the user authenticates to the website via Google ClientLogin and the apps authenticate/get authorized via GAE's built-in oauth provider. (OAuth is being used here mostly for authentication, my app doesn't actually use any external data via OAuth other than the user