restful-authentication

Symfony2 won't load custom authentication provider, loads DaoAuthenticationProvider

允我心安 提交于 2019-12-04 02:25:47
问题 This is a continuation of my last question. Hi, I'm implementing, in a Symfony2 application, a custom authentication provider in order to authenticate against the Wordnik REST API. On application load, no matter what request path, this is the exception I get: ( ! ) Fatal error: Cannot access parent:: when current class scope has no parent in /[..]/WordRot/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php on line 43 You can see

What status code should I use when session token is invalid?

戏子无情 提交于 2019-12-03 22:18:01
When creating a web service (RESTful), what status code should I use when session token is invalid? Currently the one in my company sends me a 404, not found, but I think this is not correct, because the resource exists. Maybe I should use 401 Unauthorized. What do you think? What status code do you recommend me to use in this scenario? Thanks. 401 Unauthorized. Your existing session token doesn't authorize you any more, so you are unauthorized. Don't forget that a session token is just a short-cut to avoid having to provide credentials for every request. Sending 404 is incorrect because, as

How to make Django REST JWT Authentication scale with mulitple webservers?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 20:51:57
I currently have a Django app that is simply a bunch of REST APIs (backed by a database of course). I am managing my authentications with Django REST framework JWT . It's working fine. Whenever a user logs in, one of my API returns a token that the consuming application stores for later usage. So far so good. However, in the future, this solution will need to scale. And instead of having a single server running the Django app, I can forsee a situation when I will need multiple Webservers. Of course all those webservers will be connected to the same Database. But since the token is not stored

Recommended configuration for both web client and mobile REST api security

本小妞迷上赌 提交于 2019-12-03 17:35:16
问题 I realize there are a ton of questions on this subject, and I have been researching this for a couple days now. I want to make sure my question is as specific as possible since I have yet to gain a full understanding of the best approach. Currently I have a developed django site, with the web client communicating probably about 95% via a django-piston json REST api. The other 5% is some remaning login functionality that still goes through POST forms with CSRF protection. Ideally I would like

Securing Grails REST service for use with mobile applications

三世轮回 提交于 2019-12-03 14:02:41
I am busy doing some research into using REST services with mobile applications and would appreciate some insight. The scenario is as follows. Consider a web application that provides a service to users. The web application will also be the main interaction point for the users. This will be done in Grails, and secured with Spring Security. Now, we want to provide a REST service so that users can use the service via mobile applications. Since Grails has such nice support for making the existing web application RESTful, we will use the built-in Grails support for that. My question now is, what

How to design URL to return data from the current user in a REST API?

自作多情 提交于 2019-12-03 12:52:06
I have a REST based service where a user can return a list of their own books (this is a private list). The URL is currently ../api/users/{userId}/books With each call they will also be supplying an authentication token supplied earlier. My question(s) is: Is supplying the userId in the URL redundant? As we get a token with each call we can find out which user is performing the call and return their list of books. The userId is not strictly required. Would removing the userId break REST principles as /users/books/ looks like it should return all books for all users? Should I just bite the

Add Authentication to ASP.NET WebApi 2.2

我的梦境 提交于 2019-12-03 12:31:32
I have created a WebApi 2.2 project (from an Empty New ASP.NET Project) to prove some implementation concepts and I now want to add Authentication to it. I notice that the only way to add Authentication on a new WebApi app is to use one of the (VS 2013, in my case) Templates. Is there a sure-fire way of adding Authentication to an already existing WebApi 2.2 app? I will only want to use bearer tokens, if that makes a difference to any answers I may receive. Yes you can add the bearer authentication from scratch, I'm not big fan of the VS 2013 templates because they mix between cookies and

RestSharp - Authorization Header not coming across to WCF REST service

与世无争的帅哥 提交于 2019-12-03 11:19:17
问题 I am trying to call a locally hosted WCF REST service over HTTPS with basic auth. This works and the Authorization header comes thru just fine and all is happy: ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertficate; var request = (HttpWebRequest)WebRequest.Create("https://localhost/MyService/MyService.svc/"); request.Method = "GET"; request.ContentType = "application/json"; request.Headers.Add( System.Net.HttpRequestHeader.Authorization, "Basic " + this

Getting Access to HttpServletRequest object in restful web service

你说的曾经没有我的故事 提交于 2019-12-03 10:42:20
I can get access to the HttpServlet Request object in a soap web service as follows: Declaring a private field for the WebServiceContext in the service implementation, and annotate it as a resource: @Resource private WebServiceContext context; To get the HttpServletRequet object, I write the code as below: MessageContext ctx = context.getMessageContext(); HttpServletRequest request =(HttpServletRequest)ctx.get(AbstractHTTPDestination.HTTP_REQUEST); But these things are not working in a restful web service. I am using Apache CXF for developing restful web service. Please tell me how can I get

JAX-RS and custom authorization

混江龙づ霸主 提交于 2019-12-03 10:03:30
问题 I'm trying to secure the JAX-RS endpoint and am currently trying to figure out how the authentication and authorization work. Most examples are quite simple as they only piggyback from Java EE App-Server role via web.xml. I'm wondering how to use something else than the Java EE AS roles. For example: I'd like to use session or some sort of token (or some sort of identifier). 回答1: It all depends upon the JAX-RS implementation you're using. I'm using Jersey on embedded Jetty. SecurityHandler sh