I'm looking for a tutorial/example/explanation about writing a two-legged provider for OAuth in Django.
It's hard to find documentation about a OAuth provider, and even harder about a two-legged system...
I'm looking for a tutorial/example/explanation about writing a two-legged provider for OAuth in Django.
It's hard to find documentation about a OAuth provider, and even harder about a two-legged system...
This is a good starting article: http://philipsoutham.com/post/2172924723/two-legged-oauth-in-python
Two-legged OAuth for Piston: https://github.com/gregbayer/django-piston-two-legged-oauth
'2 legged' is just normal OAuth request without an access token or access token secret. That's it. You still use the client credentials (identifier and secret) but use empty strings for the access token parameters. Depending on the server library you use, you can omit the oauth_token parameter when making the request.
I spent about 3 days trying to figure this out and wanted to provide anyone who can use it with this working example I finally got from the service I was trying to query. It wound up being extremely easy. P.S. Just because someone is using oauth 1.0 doesn't mean that you can't use the oauth2 library.
To get auth2, type pip install oauth2.
In your script, you need:
Calling the function and viewing the output looks like this: