authorization

AngularJS clientside routing and token authentication with webapi

烂漫一生 提交于 2019-11-27 10:06:45
I want to create an example for authentication and authorization in an SPA angularjs application using asp.net mvc webapi as the backend and client side routing (no cshtml). Below is just example of functions that can be used to set up the complete example. But I just can´t put it all togehter. Any help appreciated. Questions: What is best practise: Cookie or Token based? How do I create the bearer token in angular to authorize on each request? Validation on API functions? How do I preserve the autentication signed in user on the client? Example code: Sign in form <form name="form" novalidate>

ASP.NET MVC - Alternative to Role Provider?

依然范特西╮ 提交于 2019-11-27 09:59:52
I'm trying to avoid the use of the Role Provider and Membership Provider since its way too clumsy in my opinion, and therefore I'm trying to making my own "version" which is less clumsy and more manageable/flexible. Now is my question.. is there an alternative to the Role Provider which is decent? (I know that I can do custom Role provier, membership provider etc.) By more manageable/flexible I mean that I'm limited to use the Roles static class and not implement directly into my service layer which interact with the database context, instead I'm bound to use the Roles static class which has

Google Cloud Endpoints limitations… any proposed solutions?

一世执手 提交于 2019-11-27 09:57:08
问题 Am I correct in thinking that the goodness of Cloud Endpoints comes with the following limitations: The REST Api cannot be deployed to a custom domain (it'll remain on appspot.com). The only authentication supported is OAuth against Google accounts. Corollary: it isn't currently possible to create a user login/session-tracking mechanism that is Google-accounts-agnostic (e.g., with email as username and a password). Is there any plan to do away with these limitations and if so, what is the ETA

My CustomAuthorizationPolicy.Evaluate() method never fires

蹲街弑〆低调 提交于 2019-11-27 09:48:46
I create a wcf service with custom authorize and authentication as you can see: public class AuthorizationPolicy : IAuthorizationPolicy { string id = Guid.NewGuid().ToString(); public string Id { get { return this.id; } } public System.IdentityModel.Claims.ClaimSet Issuer { get { return System.IdentityModel.Claims.ClaimSet.System; } } // this method gets called after the authentication stage public bool Evaluate(EvaluationContext evaluationContext, ref object state) { // get the authenticated client identity IIdentity client = HttpContext.Current.User.Identity; // set the custom principal

How to define the basic HTTP authentication using cURL correctly?

本秂侑毒 提交于 2019-11-27 09:48:23
问题 I'm learning Apigility (Apigility docu -> REST Service Tutorial) and trying to send a POST request with basic authentication via cURL: $ curl -X POST -i -H "Content-Type: application/hal+json" -H "Authorization: Basic YXBpdXNlcjphcGlwd2Q=" http://apigilityhw.sandbox.loc/status YXBpdXNlcjphcGlwd2Q= is the base 64 encoded string with my credentials apiuser:apipwd . The credentials are saved in the /data/htpasswd ( apiuser:$apr1$3J4cyqEw$WKga3rQMkxvnevMuBaekg/ ). The looks like this: HTTP/1.1

Why is <deny users=“?” /> included in the following example?

假如想象 提交于 2019-11-27 09:44:28
问题 The ? wildcard represents unauthenticated users while * represents all users, authenticated and unauthenticated. My book shows the following example of URL authorization: <authorization> <deny users="?" /> <allow users="dan,matthew" /> <deny users="*" /> </authorization> But doesn’t the above code have the same effect as : <authorization> <allow users="dan,matthew" /> <deny users="*" /> </authorization> or did the author also include <deny users="?" /> rule for a reason? 回答1: ASP.NET grants

Google App Scripts cannot be given Authorization or Permission

霸气de小男生 提交于 2019-11-27 09:37:12
Why am I not able to give permission/authorization to a Google Apps Script that I also made using the same Google account? It seems like Google doesnt trust myself to use my own Google Apps Script with my own Spreadsheet. Here is the line of code that breaks everything. If this line doesnt exist, I'm not asked for permission. var sheet = SpreadsheetApp.getActiveSheet(); So it's trying to access the spreadsheet that created this Google Apps Script, also made using my account but I cant grant permission. When I run the line of code above, I am told I need to give permissions, so I do by

spring-security: authorization without authentication

隐身守侯 提交于 2019-11-27 09:27:17
问题 I'm trying to integrate Spring Security in my web application. It seems pretty easy to do as long as you integrate the whole process of authentication and authorization. However, both authentication and authorization seem so coupled that it's being very time-consuming for me to understand how I could split these processes, and get authentication independently of authorization. The authentication process is external to our system (based on single sign-on) and this cannot be modified.

How require authorization within whole ASP .NET MVC application

限于喜欢 提交于 2019-11-27 08:51:51
I create application where every action beside those which enable login should be out of limits for not logged user. Should I add [Authorize] annotation before every class' headline? Like here: namespace WebApplication2.Controllers { [Authorize] public class HomeController : Controller { public ActionResult Index() { return View(); } public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); } public ActionResult Contact() { ViewBag.Message = "Your contact page."; return View(); } } } or there is a shortcut for this? What if I want to change rules for

ABAddressBookGetAuthorizationStatus in simulator always returns kABAuthorizationStatusAuthorized

一个人想着一个人 提交于 2019-11-27 08:09:37
问题 I am updating an app for iOS 6 Address Book authorization and have hit a problem in testing. The simulator always returns that authorization is granted. This means I do not see the dialog popup requesting permission and can therefore not test that code path. Ok, use a device instead... The problem there is the OS appears to remember my answer so only asks once. Deleting the app does not help. On reinstalling it has retained the permission setting from before, so again no popup. Resetting the