Discussion:
oauth for Python 3
Barry Warsaw
2012-05-24 16:10:16 UTC
Permalink
One of the packages that I'm constantly bumping up against as I port more code
to Python 3 is oauth. We really need a semi-official (or at least popular
<wink>) Python 3 compatible oauth client library.

I'm CC'ing Jason DeRose since I've had several conversations with him about
this, and I believe he has a package that would fit the bill, although I'm not
sure if it's available on PyPI yet.

I know I've spoken to at least one other person who knew of, or was working
on, a Python 3 compatible oauth library, but I can't remember who that is.

The most popular oauth package on the Cheeseshop is oauth 1.0.1, but afaik
upstream has abandoned it, and it has had a new version on PyPI in since
September 2009. I'm not personally very keen on adopting it in order to port
it.

There are many other hits for 'oauth' on PyPI, but none of the client
libraries are Python 3 compatible already afaict.

It would be really fantastic if a Python 3 compatible oauth library existed on
PyPI, and it would be even better (maybe) if it was API compatible with oauth
1.0.1.

Is anybody else out there trying to do oauth client interaction in Python 3,
and if so, what are you using? Jason, maybe you can speak about your library
and whether it can or will be available on PyPI?

Cheers,
-Barry
Brian Curtin
2012-05-24 16:17:36 UTC
Permalink
Post by Barry Warsaw
One of the packages that I'm constantly bumping up against as I port more code
to Python 3 is oauth.  We really need a semi-official (or at least popular
<wink>) Python 3 compatible oauth client library.
I'm CC'ing Jason DeRose since I've had several conversations with him about
this, and I believe he has a package that would fit the bill, although I'm not
sure if it's available on PyPI yet.
I know I've spoken to at least one other person who knew of, or was working
on, a Python 3 compatible oauth library, but I can't remember who that is.
Perhaps it was Rodney Dawes (also at Canonical).
https://launchpad.net/poauth is on his radar for moving U1 towards 3.x
support.

(I saw you ask the same thing on Twitter but I figured I'd answer here
as well for the benefit of the group)
Guido van Rossum
2012-05-24 16:27:51 UTC
Permalink
The OAuth protocol is already being abandoned in favor of OAuth2.
Whatever package you choose please be sure it uses OAuth2. Google has
an "oauth2client" library but sadly it is horribly over-engineered and
I cannot recommend it.
Post by Brian Curtin
Post by Barry Warsaw
One of the packages that I'm constantly bumping up against as I port more code
to Python 3 is oauth.  We really need a semi-official (or at least popular
<wink>) Python 3 compatible oauth client library.
I'm CC'ing Jason DeRose since I've had several conversations with him about
this, and I believe he has a package that would fit the bill, although I'm not
sure if it's available on PyPI yet.
I know I've spoken to at least one other person who knew of, or was working
on, a Python 3 compatible oauth library, but I can't remember who that is.
Perhaps it was Rodney Dawes (also at Canonical).
https://launchpad.net/poauth is on his radar for moving U1 towards 3.x
support.
(I saw you ask the same thing on Twitter but I figured I'd answer here
as well for the benefit of the group)
_______________________________________________
Python-porting mailing list
http://mail.python.org/mailman/listinfo/python-porting
--
--Guido van Rossum (python.org/~guido)
Barry Warsaw
2012-05-24 20:16:46 UTC
Permalink
Post by Guido van Rossum
The OAuth protocol is already being abandoned in favor of OAuth2.
Whatever package you choose please be sure it uses OAuth2. Google has
an "oauth2client" library but sadly it is horribly over-engineered and
I cannot recommend it.
Currently, Launchpad doesn't support OAuth2, so while I agree this would be an
important feature for a general purpose Python 3 compatible library, it's not
a requirement for my immediate needs.

Rodney Dawes is the other person who was talking about a Python 3 OAuth
library, but he is also only needs OAuth1 atm, and his library is not yet
ready for a Python 3 compatible release. So I think right now, there is
basically nothing available.

I'm going to experiment with porting the original oauth library to Python 3.
If it works out, I'll figure out what to do from there.

Cheers,
-Barry
Guido van Rossum
2012-05-24 21:55:28 UTC
Permalink
Post by Barry Warsaw
Post by Guido van Rossum
The OAuth protocol is already being abandoned in favor of OAuth2.
Whatever package you choose please be sure it uses OAuth2. Google has
an "oauth2client" library but sadly it is horribly over-engineered and
I cannot recommend it.
Currently, Launchpad doesn't support OAuth2, so while I agree this would be an
important feature for a general purpose Python 3 compatible library, it's not
a requirement for my immediate needs.
Yeah, but your immediate needs don't necessarily fit the standard library. :-)
Post by Barry Warsaw
Rodney Dawes is the other person who was talking about a Python 3 OAuth
library, but he is also only needs OAuth1 atm, and his library is not yet
ready for a Python 3 compatible release.  So I think right now, there is
basically nothing available.
I'm going to experiment with porting the original oauth library to Python 3.
If it works out, I'll figure out what to do from there.
I would object to including something in the stdlib that's already
known to be out of date.
--
--Guido van Rossum (python.org/~guido)
Barry Warsaw
2012-05-24 22:11:31 UTC
Permalink
Post by Guido van Rossum
Post by Barry Warsaw
Currently, Launchpad doesn't support OAuth2, so while I agree this would be
an important feature for a general purpose Python 3 compatible library,
it's not a requirement for my immediate needs.
Yeah, but your immediate needs don't necessarily fit the standard library. :-)
Post by Barry Warsaw
I'm going to experiment with porting the original oauth library to Python 3.
If it works out, I'll figure out what to do from there.
I would object to including something in the stdlib that's already
known to be out of date.
Oh, I completely agree about that. I wasn't thinking about the stdlib, but
eventually when we have a modern, standards-compliant, battle-tested third
party library on the Cheeseshop, I do think it would make a nice addition to
Python 3, but probably not until 3.3.

Cheers,
-Barry
Barry Warsaw
2012-05-24 20:20:03 UTC
Permalink
I don't yet have a Python3 OAuth library, but I implemented OAuth 1a
internally in my Python3 CouchDB "REST adapter", which I still need to get
https://launchpad.net/microfiber
I only implemented the client functionality, but as far as I know, that's all
that's needed for libraries like launchpadlib. I felt the python-oauth API
http://bazaar.launchpad.net/~microfiber/microfiber/trunk/view/head:/microfiber.py#L152
My plan is to split this out into its own module, and then to add a
python-oauth compatibility API (at least for the client functionality
actually being used). And then I'll try porting lauchpadlib to this
(sticking with Python2 at first).
Realistically, I wont have a chance to do this till I return from Linaro
Connect on May 2nd.
Python3 FTW!
Thanks for the update. See my previous follow up.

Cheers,
-Barry
Roland Hedberg
2012-05-24 21:15:22 UTC
Permalink
I don't yet have a Python3 OAuth library, but I implemented OAuth 1a
internally in my Python3 CouchDB "REST adapter", which I still need to get
I've written a OpenID Connect library in Python 2.7 .
It should be rather straight forward to translate it to Python3.
Since OpenID Connect is an extension of OAuth2, it contains a OAuth2 library too.

https://github.com/rohe/pyoidc

The OpenID Connect implementation is done on behalf of Kantara and is done in close cooperation with the team that writes the specification.
It's the basis of a functional test tool, already in use to verify other implementations.
So it is in essence the reference implementation.

-- Roland
------------------------------------------------------
Roland Hedberg
IT Architect/Senior Researcher
ICT Services and System Development (ITS)
Umeå University
SE-901 87 Umeå, Sweden
Phone +46 90 786 68 44
Mobile +46 70 696 68 44
www.its.umu.se
Barry Warsaw
2012-05-24 22:16:04 UTC
Permalink
I've written a OpenID Connect library in Python 2.7 . It should be rather
straight forward to translate it to Python3. Since OpenID Connect is an
extension of OAuth2, it contains a OAuth2 library too.
I took a quick look at the install_requires from your setup.py. It looks like
only M2Crypto still needs a Python 3 port.

Cheers,
-Barry
Roland Hedberg
2012-05-26 13:35:32 UTC
Permalink
Post by Barry Warsaw
I've written a OpenID Connect library in Python 2.7 . It should be rather
straight forward to translate it to Python3. Since OpenID Connect is an
extension of OAuth2, it contains a OAuth2 library too.
I took a quick look at the install_requires from your setup.py. It looks like
only M2Crypto still needs a Python 3 port.
Note though that this library was designed to be able to cope with continuous changing specifications.
So it's not optimized for speed or memory usage.
It's also not battle tested as someone put it.
But it's a starting point.

-- Roland
------------------------------------------------------
Roland Hedberg
IT Architect/Senior Researcher
ICT Services and System Development (ITS)
Umeå University
SE-901 87 Umeå, Sweden
Phone +46 90 786 68 44
Mobile +46 70 696 68 44
www.its.umu.se

Jason Gerard DeRose
2012-05-24 16:51:50 UTC
Permalink
Post by Barry Warsaw
One of the packages that I'm constantly bumping up against as I port more code
to Python 3 is oauth. We really need a semi-official (or at least popular
<wink>) Python 3 compatible oauth client library.
I'm CC'ing Jason DeRose since I've had several conversations with him about
this, and I believe he has a package that would fit the bill, although I'm not
sure if it's available on PyPI yet.
I don't yet have a Python3 OAuth library, but I implemented OAuth 1a
internally in my Python3 CouchDB "REST adapter", which I still need to get
up on PyPI, but can also be found on Launchpad:

https://launchpad.net/microfiber

I only implemented the client functionality, but as far as I know, that's
all that's needed for libraries like launchpadlib. I felt the python-oauth
API was way over complicated, so I wrote a simple, functional
implementation:

http://bazaar.launchpad.net/~microfiber/microfiber/trunk/view/head:/microfiber.py#L152

My plan is to split this out into its own module, and then to add a
python-oauth compatibility API (at least for the client functionality
actually being used). And then I'll try porting lauchpadlib to this
(sticking with Python2 at first).

Realistically, I wont have a chance to do this till I return from Linaro
Connect on May 2nd.

Python3 FTW!
Post by Barry Warsaw
I know I've spoken to at least one other person who knew of, or was working
on, a Python 3 compatible oauth library, but I can't remember who that is.
The most popular oauth package on the Cheeseshop is oauth 1.0.1, but afaik
upstream has abandoned it, and it has had a new version on PyPI in since
September 2009. I'm not personally very keen on adopting it in order to port
it.
There are many other hits for 'oauth' on PyPI, but none of the client
libraries are Python 3 compatible already afaict.
It would be really fantastic if a Python 3 compatible oauth library existed on
PyPI, and it would be even better (maybe) if it was API compatible with oauth
1.0.1.
Is anybody else out there trying to do oauth client interaction in Python 3,
and if so, what are you using? Jason, maybe you can speak about your library
and whether it can or will be available on PyPI?
Cheers,
-Barry
Loading...