restful-authentication

Restful API authentication recommendation?

自作多情 提交于 2019-11-30 09:15:45
I am developing several RESTful API for 3rd party to call, and these API need authentication (apikey & secret based), and authorization (HTTP method & URI based). Are there any existing software we can reuse that prevent me from rolling out our own implementation for the security layer? HTTP gives you granted support for that, so you don't need to reinvent the wheel Either use: HTTP Auth Basic (with SSL to bypass plain-text password submit problem) HTTP Auth Digest Auth Digest has advantage, that it does not transmit the passowrd in cleartext and handles replay attacks (with nonces). We use

RESTful authentication - resulting poor performance on high load?

时光毁灭记忆、已成空白 提交于 2019-11-30 08:32:38
For a RESTful web service we say that that the server shouldn't store any state. Now for every request the 'user' must be authenticated and must have an authorization for the action(s) he/she wishes to carry out. Now every request will contain authorization data for that user. Here are my confusions: Assuming there is a login and password field on the home-page. The user enters the username/password which is sent back to the server, user verified and then 'some token' is returned. Now this token is sent to the server on every request. Question(s): Does the backend DB need to have a separate

HTTP Client based on NodeJS: How to authenticate a request?

十年热恋 提交于 2019-11-30 07:57:17
This is the code I have to make a simple GET request: var options = { host: 'localhost', port: 8000, path: '/restricted' }; request = http.get(options, function(res){ var body = ""; res.on('data', function(data) { body += data; }); res.on('end', function() { console.log(body); }) res.on('error', function(e) { console.log("Got error: " + e.message); }); }); But that path "/restricted" requires a simple basic HTTP authentication. How do I add the credentials to authenticate? I couldn't find anything related to basic http authentication in NodeJS' manual . Thanks in advance. You need to add the

Symfony2 App with RESTful authentication, using FOSRestBundle and FOSUserBundle

﹥>﹥吖頭↗ 提交于 2019-11-30 07:32:43
I'm making REST API for my JS driven app. During login, the login form is submitted via AJAX to url /rest/login of my API. If the login is succesful, it returns 204 If it fails, it returns 401 While I have separated firewalls for the API and the app itself, they share the same context which should mean, that when user authenticates against the API, he's authenticated against the app too. So, when the server returns 204, page will reload and it should redirect user to the app, because he's now logged in. I tried to use pre-made check_login page of the FOSUserBundle and pointed /rest/login there

AngularJS Authentication + RESTful API

≯℡__Kan透↙ 提交于 2019-11-30 06:09:34
问题 Angular+RESTful Client-side Communication w/ API for Auth/(re)Routing This has been covered in a few different questions, and in a few different tutorials, but all of the previous resources I've encountered don't quite hit the nail on the head. In a nut-shell, I need to Login via POST from http://client.foo to http://api.foo/login Have a "logged in" GUI/component state for the user that provides a logout route Be able to "update" the UI when the user logs out / logs out. This has been the

Dealing with expired access tokens in OAuth2 implicit grant

人盡茶涼 提交于 2019-11-30 05:56:29
问题 The specification of OAuth2 states that an authorization server must not issue a refresh token when using implicit grant. In our use case we protect a RESTful API with OAuth2 and use a Single Page Javascript application as a client for this API. As it would be very difficult to redirect to the authorization server after an access token has expired, we are searching for a better way to get a new valid token. I could think about two different approaches and wonder which one could be better: Use

Is the Twitter API *really* RESTful? [closed]

扶醉桌前 提交于 2019-11-30 04:53:52
Along with half of the web developer community, I've been struggling to really and truly grok the REST style. More specifically, I've been trying to form some opinions on how practical a pure RESTful architecture really is between a web browser and an application server. As part of my learning endeavor, I've been taking a look at some online examples of REST, specifically Twitter in this case. In their API documentation , they discuss their various "REST API Methods". I'm struggling with rationalizing how exactly most of these are actually RESTful, beyond having a RESTful URL structure.

Why is form based authentication NOT considered RESTful?

久未见 提交于 2019-11-30 03:31:46
Although I "think" I understand it I need some clarity. With PURE Restful authentication, things do get a bit unwieldy and using forms helps a lot with the UI of the application (i.e., get to have separate login page, forgot password links, easier logout? etc.,) Now Forms come along and some folks say "not restful" - what is "not restful" about them? Is it that there is no corresponding login resource so to speak? Or does it force something else that I'm missing? Note: If ones create sessions with them, that's a different matter altogether. I'm more keen on know "why" are they branded as

How to build a secure and RESTful service in PHP?

﹥>﹥吖頭↗ 提交于 2019-11-29 22:52:51
I'm building an application system which consists of a server part "in the cloud" and a client part, e.g. an iPhone or Android app or a web browser. Server side is implemented in PHP (LAMP) and is today a very simple server with a number of php-files serving each type of method request like: getCustomers.php, addNewCustomer.php and so on. Also, up until now, no security mechanism has been used whatsoever and the ISP hosting the server do not provide SSL. That's right, SSL is not an option for security. Now, I want to gear up my old system and make it: 1) True RESTful service, and 2) Add

Rails, Restful Authentication & RSpec - How to test new models that require authentication

ε祈祈猫儿з 提交于 2019-11-29 22:28:22
I've created a learning application using Bort , which is a base app that includes Restful Authentication and RSpec. I've got it up and running and added a new object that requires users to be logged in before they can do anything( before_filter :login_required in the controller). [edit: I should also mention that the user has_many of the new class and only the user should be able to see it.] I've created the new model/controller using Rspec's generators which have created a number of default tests. They all pass if there is no before_filter but several fail, as should be expected, once the