restful-authentication

Secured RESTful API that can be used by Web App (angular), iOS and Android

房东的猫 提交于 2019-11-29 18:48:56
I have to lay out a plan to develop a RESTful API (Python/Flask) that could be used by our future web app (Angularjs) and mobile apps (iOS/Android). I have been researching for three days and have come across several scenarios: Using HTTPS is one way on top of the methods below to keep it safer. But https is slower, which could mean we need faster and more expensive servers. Using Basic-Http-Auth and sending username/password in plain (yet https) over the wire for every request to the API. Using Digest-Auth, which is a hash of the password and the tracking would be automatic This would work

Securing REST API using custom tokens (stateless, no UI, no cookies, no basic authentication, no OAuth, no login page)

折月煮酒 提交于 2019-11-29 18:47:42
There are lots of guidelines, sample codes that show how to secure REST API with Spring Security, but most of them assume a web client and talk about login page, redirection, using cookie, etc. May be even a simple filter that checks for the custom token in HTTP header might be enough. How do I implement security for below requirements? Is there any gist/github project doing the same? My knowledge in spring security is limited, so if there is a simpler way to implement this with spring security, please let me know. REST API served by stateless backend over HTTPS client could be web app, mobile

Securing my Node.js app's REST API?

北城以北 提交于 2019-11-29 18:40:07
I could do with some help on my REST API. I'm writing a Node.js app which is using Express, MongoDB and has Backbone.js on the client side. I've spent the last two days trying to work out all of this and not having much luck. I've already checked out: Securing a REST API Securing my REST API with OAuth while still allowing authentication via third party OAuth providers (using DotNetOpenAuth) http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/ http://tesoriere.com/2011/10/10/node.js-getting-oauth-up-and-working-using-express.js-and-railway.js/ I want to keep my

RESTful web service - how to authenticate requests from other services?

自作多情 提交于 2019-11-29 18:35:32
I am designing a RESTful web service that needs to be accessed by users, but also other web services and applications. All of the incoming requests need to be authenticated. All communication takes place over HTTPS. User authentication is going to work based on an authentication token, acquired by POSTing the username and password (over an SSL connection) to a /session resource provided by the service. In the case of web service clients, there is no end user behind the client service. The requests are initiated by scheduled tasks, events or some other computer operations. The list of

Restful API authentication recommendation?

浪子不回头ぞ 提交于 2019-11-29 14:53:02
问题 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? 回答1: 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

RestTemplate basic or digest Authentication with the current httpclient (4.x)

懵懂的女人 提交于 2019-11-29 14:04:01
问题 I'm trying to do Digest mostly (or Basic) Authentication using RestTemplate and httpclient (4.x) . Since I couldn't find any relevant examples of how to actually do this, I have attempted various ways to hook the various httpclient artifacts, with no luck - essentially, no Authentication header is sent at all. My current implementation is: DefaultHttpClient newHttpClient = new DefaultHttpClient(); Credentials credentials = new UsernamePasswordCredentials( username, password ); AuthScope

setRequestHeader does not work in JSONP using jQuery

自古美人都是妖i 提交于 2019-11-29 13:19:54
I am building an iPhone app using jQuery Mobile, jQuery 1.7.2, and PhoneGap trying to get a JSONP from ASP.NET RESTful web service using this code, problem that I need to authenticate first and get a token, then send it back again. here is my function: var setToken = function () { var serverToken = ''; $.support.cors = true; jQuery('body').ajaxSend(function (evt, xhr) { xhr.setRequestHeader("Authorization", "Basic " + $.base64.encode(username + ":" + password)); xhr.setRequestHeader('X-Accept', 'application/json'); }); $.getJSON(url + "?jsoncallback=?", null, function (res) { console.log(res);

RESTful authentication - resulting poor performance on high load?

和自甴很熟 提交于 2019-11-29 11:56:41
问题 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

rails - InvalidAuthenticityToken for json/xml requests

情到浓时终转凉″ 提交于 2019-11-29 03:05:40
For some reason I'm getting an InvalidAuthenticityToken when making post requests to my application when using json or xml. My understanding is that rails should require an authenticity token only for html or js requests, and thus I shouldn't be encountering this error. The only solution I've found thus far is disabling protect_from_forgery for any action I'd like to access through the API, but this isn't ideal for obvious reasons. Thoughts? def create respond_to do |format| format.html format.json{ render :json => Object.create(:user => @current_user, :foo => params[:foo], :bar => params[:bar

Authentication/authorization in JAX-RS using interceptors and injection

夙愿已清 提交于 2019-11-29 02:24:43
I am developing a new application in JavaEE 7 using WildFly 8. I am using JAX-RS to provide a RESTful service interface for remote applications. Something like an HttpHeaders object can be injected in a resource method arguments using the @Context annotation. Since the object is based on request parameters (of course, the HTTP headers), I came up with the idea of creating my own injectable User object which is created based on the presence of a valid token in the request (something like an OAuth access token). So, I want to achieve something like this: @Path("/resources") public class