Git Product home page Git Product logo

django-restless-oauth's Introduction

Django Restless OAuth

Build Status

Django Restless OAuth is an add-on for Django Restless for creating OAuth 1 providers. It uses the low level oauthlib library.

Consider it alpha-quality software. DO NOT use in production (esp. see the security issue described below).

Installation

Install via Github:

    pip install https://github.com/dobarkod/django-restless-oauth/archive/master.zip

Quickstart

  • Make sure you use the Sites framework and that your site URL is correctly set (needed for OAuth URL verification)

  • Make sure you use HTTPS (oauthlib will complain otherwise, and be right about it)

  • Restless OAuth provides resources for 3-legged OAuth authorization in django_restless.urls. In your project's urls.py add:

      import restless_oauth.urls
    
      urlpatterns += ('',
          url(r'^oauth/', include(restless_oauth.urls))
      )
    
  • In views that should use OAuth authorization, use OAuthMixin:

      from restless_oauth.views import OAuthMixin
    
      class ProtectedEndpoint(Endpoint, OAuthMixin):
    
          @login_required
          def get(self, request):
              return { 'username': request.user.username }
    
  • OAuthMixin will attempt to authenticate the request and assign request.user as appropriate; you can use DjangoRestless' login_required to make sure it's set

WARNING: /oauth/authorize (2nd step in 3-legged OAuth authentication flow) as implemented by restless_oauth.views.Authorize will auto-authorize any request if the user is logged in. You MUST override this and ask the user whether they authorize the app.

Documentation

There's not much documentation yet, please see the tests for examples.

License

Copyright (C) 2012. by Senko Rašić and Django Restless OAuth contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

django-restless-oauth's People

Contributors

denibertovic avatar senko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

django-restless-oauth's Issues

GET query string problems

There's apparently a problem with GET (or any, in fact) requests with query string parameters which don't get signed / verified correctly, and the request is forbidden.

Someone should look into this and check whether it's a problem with restless-oauth, example/test code (incorrect request signing), or something else.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.