authorization

Best way to create a TOKEN system to authenticate web service calls?

梦想与她 提交于 2019-11-28 16:24:38
I'd like to create a web service architecture that can be called by various platforms such as mobile devices, winforms applications, iphone, blackberry, you name it. So going with something like WCF and wsHttp binding probably kills this and I would need to downgrade to a basicHttp binding for compatibility. With that said, I need a system to generate a token on initial login (authentication) and then use this token for all subsequent calls, I guess, to validate the authentication and allow the method to execute. Anyone have tips or suggestions on how to go about this? 1) Generate a token and

Where should I plugin the Authorization in Asp.net WebAPI?

China☆狼群 提交于 2019-11-28 16:14:13
As I see I have 3 possible places to plug my stuff in the pipeline 1) AuthorizationFilters 2) Action Filters 3) DelegatingHandler The most obvious one is AuthorizationFilters , where I can decorate my actions/ controllers with my custom authorization attribute . say .. MyCustomAuthorizationAttribute . Since HTTP message handlers are in the first stage in the processing pipeline. Does it make any sense to put it in there ? Authorization for me right now simply means checking a token in the header which is given to the client after authentication. Update July 2014 My original answer covered

How to send custom headers with requests in Swagger UI?

寵の児 提交于 2019-11-28 16:11:39
I have some endpoints in the API - /user/login , /products . In Swagger UI I post email and password to /user/login and as a response I receive a token string. Then, I can copy the token from the response and want to use it as Authorization header value in requests to all urls if it's present, and to /products as an example. Should I create a text input manually somewhere on the Swagger UI page, then put the token there and somehow inject in the requests or are there tools to manage it in a better way? You can add a header parameter to your request, and Swagger-UI will show it as an editable

spring-security: authorization without authentication

十年热恋 提交于 2019-11-28 16:01:15
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. Nevertheless, once the user succeeds this process, it's loaded in the session, including roles. What we are

Which authentication and authorization schemes are you using - and why?

戏子无情 提交于 2019-11-28 15:47:58
问题 We're beginning to design a whole bunch of new services to create (WCF, ADO.NET Data Services, possibly in the cloud at some point) and one question that pops up is what authentication and authorization scheme to use - there are quite a few! We basically need to be able to identify users (actual people, and "virtual" application/service users) on a wide variety of protocols - HTTP, HTTPS, TCP - and we need to assign them at least a bunch of roles / permission to see certain data and/or do

Customize the Authorization HTTP header

半城伤御伤魂 提交于 2019-11-28 15:27:39
问题 I need to authenticate a client when he sends a request to an API. The client has an API-token and I was thinking about using the standard Authorization header to send the token to the server. Normally this header is used for Basic and Digest authentication. But I don't know if I'm allowed to customize the value of this header and use a custom auth-scheme, e.g: Authorization: Token 1af538baa9045a84c0e889f672baf83ff24 Would you recommend this or not? Or is there an better approach to sending

Using Claim-Based Authorization

 ̄綄美尐妖づ 提交于 2019-11-28 15:23:07
问题 The new ASP.NET 4.5 code has "re-parented" the ASP.NET RoleProvider to a ClaimsProvider. What I'm trying to figure out, is what would a "claims based" example of authorization look like (preferably in MVC4)? How does my Authorize attribute interact, or not, with this capability? The WebSecurity and Roles API havn't changed; there is no "DoesUserHaveClaim()" signature. Similarly, it is not clear how the Authorize attribute interacts with claims. Was this "claims authorization" feature intended

How to prevent CSRF in a RESTful application?

别等时光非礼了梦想. 提交于 2019-11-28 15:22:38
Cross Site Request Forgery (CSRF) is typically prevent with one of the following methods: Check referer - RESTful but unreliable insert token into form and store the token in the server session - not really RESTful cryptic one time URIs - not RESTful for the same reason as tokens send password manually for this request (not the cached password used with HTTP auth) - RESTful but not convenient My idea is to use a user secret, a cryptic but static form id and JavaScript to generate tokens. <form method="POST" action="/someresource" id="7099879082361234103"> <input type="hidden" name="token"

How to constrain read/write rules to the users that create the nodes while keeping this structure?

感情迁移 提交于 2019-11-28 12:50:30
问题 The goal is that the users are able to write to the buildings and depts node but only to the ones they create. I.E: if a user creates node A in buildings only him can read/write to node A . This is essential the database structure: { "buildings" : { "-L9HIbKu5fIe8rfoePgi" : { "address" : "", "hasDepts" : { "-L9HIdScisDItysCnMlm" : true }, "name" : "building 1", "ownerID" : "6hwNde08Wuaa9bfReR28niSbOsF3" } }, "depts" : { "-L9HIdScisDItysCnMlm" : { "inBuilding" : "-L9HIbKu5fIe8rfoePgi", "name"

Angular5 WebApi token authorization not working

限于喜欢 提交于 2019-11-28 11:17:00
问题 I'm trying to implement token authorization for Angular5 client and WebApi server application. I have managed to create WebApi part of the project in question and when I try to get the token via "POSTMAN" I get a good response: Postman request and server answer I'm trying to achieve the same with Angular5. This is my call from angular: login(user: string, pass: string) { let params = new HttpParams() .append('grant_type', 'password') .append('username', user) .append('password', pass); let