restful-authentication

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

删除回忆录丶 提交于 2019-12-05 02:14:31
问题 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

JWT: Authentication in slim v3 and Android

半城伤御伤魂 提交于 2019-12-05 01:44:08
问题 I am using Slim framework to return JSON to my Android device. I am currently working on login on my device. I am using 3 different ways to login: Facebook, Google and account login. When he takes account login he can register a new account or login with an existing one. For security on my web service I thought to use JWT security. So I am reading and watching video's about how it works. I think I understand how it works, but I cannot find anything about how to implement it correctly. The

Securing Grails REST service for use with mobile applications

烂漫一生 提交于 2019-12-04 20:54:37
问题 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

Create a PostMan GET Request with JWT

我与影子孤独终老i 提交于 2019-12-04 18:25:18
I am new using PostMan; normally I use curl: this one to get the JTW curl -X POST -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{ "username": "peris","password": "3nRam0nD3L3s0l1v3s" }' "http://139.152.231.107:1133/canPeris/auth" and this other one using the JTW obtained before curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciJIUzUxMiJ9.eyJzdWIiOiJsb3Blei5hbnRvbmlvODVAZ21haWwuY29tIiwiZXhwIjoxNTkwMDQ3NTg4LCJpYXQiOjE1Mh9.3vlQBgfA22ffJZqNic2lVSHiMR6YudlCFoldfwzdk-clz6_XyOvCVTrMihXtYBaJuPI515zTwAnaQBV

Getting Access to HttpServletRequest object in restful web service

安稳与你 提交于 2019-12-04 16:35:45
问题 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

How to manage authentication with token in angular.js?

我与影子孤独终老i 提交于 2019-12-04 15:02:02
Hi Everyone I created a RESTful API with authentication with token (Rails 4 + Devise), Also I manage the CORS implementation with a gem(rack-cors) but now I would like use the API with angular.js For this I do this: var app = angular.module('models'); app.factory('Session',['$resource',function($resource){ var Session = $resource( 'http://api.creositios.dev/sessions/:id', {}, { create: { method: 'POST'}, delete: { method: 'DELETE', params: { id: '@id'} } } ); return Session; }]); And this is my controller app = angular.module('controllers'); app.controller('SessionCtrl',['$scope','Session'

What is the correct way of find out if user is logged in in MVC WEB API?

北慕城南 提交于 2019-12-04 14:23:09
问题 I am very confused about this problem. Restfull service make it up to you to decide which way to implement this functionallity. Ive read multiple articles about this problem, but every article says something different. For example some people propopse sessions, but if you do that Web api is losing its "rest fullness". Other people suggest cockies. I dont know if what i am done is actually done right: On login of user i create a cockie which contains UserID(Guid) and on every request which

How do I authenticate to Visual Studio Team Services and Team Foundation Server with a Personal Access Token?

有些话、适合烂在心里 提交于 2019-12-04 13:48:16
问题 From PowerShell, how do I use Personal Access Tokens (PAT) to authenticate to my Visual Studio Team Services (VSTS) account or on-premises Team Foundation Server (TFS)? 回答1: As of July 2015, Visual Studio Online allows users to create Personal Access Tokens (PAT) as a more secure option than alternate credentials . To authenticate to the REST APIs, all you need to do is use the PAT as the password portion in a Basic Auth HTTP Header along with your REST request. $personalAccessToken = "your

Pass Authenticity token through http header

怎甘沉沦 提交于 2019-12-04 12:50:42
I have a rails application that uses a token to authenticate the user. Currently I am passing the token as params. I would like to change this. I believe it is possible to pass it through html header. I dont understand how to use authenticate_or_request_with_http_token do |token, options| . My rails app is actually a server for my iphone client. I things I dont understand are: I know options is nonce but how will that work out between my client and server? How do I actually use this in my server code. I can use authenticate_or_request_with_http_token do |token, options| to check for token in

Rest - how get IP address of caller

落花浮王杯 提交于 2019-12-04 09:57:24
问题 I am writing a Java Rest Web Service and need the caller's IP Address. I thought I saw this in the cookie once but now I don't see it. Is there a consistent place to get this information? I saw one example of using an "OperationalContext" to get it but that was not in java. 回答1: I think you can get the IP through the request object. If I'm not mistaken, request.getRemoteAddr() or so. 回答2: Inject a HttpServletRequest into your Rest Service as such: import javax.servlet.http.HttpServletRequest;