Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication #23

Open
kyrias opened this issue Mar 27, 2015 · 4 comments
Open

Authentication #23

kyrias opened this issue Mar 27, 2015 · 4 comments

Comments

@kyrias
Copy link

kyrias commented Mar 27, 2015

I haven’t had time to go through the library yet, but how hard would you estimate that it would be to add HTTP basic auth support?

@tcalmant
Copy link
Owner

I haven't tested it, but as it is based on the xmlrpclib transport classes, it should support basic auth as is, using the http://user:pass@host:port/path URL format. (again: not tested).

Else, it would be necessary to work on the Transport and SafeTransport classes to override the creation of the HTTP(S) connection.

@kyrias
Copy link
Author

kyrias commented Mar 27, 2015

I meant something like giving SimpleJSONRPCServer a list of dicts containing combinations of usernames and passwords, so you could have different passwords for different users. I’ll see about looking into it later though.

@tcalmant
Copy link
Owner

In this case, you have to handle the basic authentication in the request handler.
You can take a look at this blog post to see how it could be implemented (jsonrpclib inherits from xmlrpclib classes, so it should be easy to port).
Maybe this could become a Mixin in jsonrpclib...

@kyrias
Copy link
Author

kyrias commented Mar 27, 2015

(Also, just tested regular basic auth URL syntax, and the header isn’t sent properly, so I will have to look into seeing about that first)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants