Add support for auth tokens
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
txJSON-RPC |
In Progress
|
Medium
|
Duncan McGreggor |
Bug Description
We want to be able to support a simple login and logout use case with both the txJSON-RPC Proxy as well as generic jsonrpc proxies. The first step in this direction is supporting an auth token mechanism.
Generic jsonrpc proxy/client use case:
* When a user sends a request to login, they supply a username and password
* The JSON-RPC server responds to an unsuccessful login request by raising an exception
* The JSON-RPC server responds to a successful login request by sending an auth token
* Subsequent requests to protected resources may be made without username or password by sending the auth token in a query string, e.g.: ?auth-token=XXX
txJSON-RPC Proxy use case:
* When a user sends a request to login, they supply a username and password
* The JSON-RPC server responds to an unsuccessful login request by raising an exception
* The JSON-RPC server responds to a successful login request by setting the X-Auth-Token header in the response
* The Proxy instance automatically parses this header, and all subsequent requests that don't have a username and password are automatically sent with the X-Auth-Token header set
Some of the implementation needs to happen at the top-level Site object, so we may want to subclass twisted.
Changed in txjsonrpc: | |
assignee: | nobody → Duncan McGreggor (oubiwann) |
importance: | Undecided → Medium |
milestone: | none → 0.3 |
status: | New → In Progress |
I am try to write some code ^))
And has collision as I wrote before.
How to capture auth_token from request in twisted authentification?
Because if we send BasicAuth header to server -- twisted auth must check it, another side checker will be rejected request.
Another problem is: server. request. getSession method because it handle session by coockie. server. Session class.
if we inherit from tw.web.server.Site to implement sessionstate issue, we must change tw.web.
But if we do it -- we can use standart tw.web.
Please clarify me: We create new QueryAuthProtocol class, who send login request on first call or not?