Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    basic_oauth 0.1.4

    Download button

    No screenshots available
    Downloads: 67  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Sam Alba | More programs
    MIT/X Consortium Lic... / FREE
    September 24th, 2012, 18:32 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    basic_oauth description

    Implements the "Resource Owner Password Credentials Grant" from Oauth v2

    The Oauth v2 spec defines several authorization grant.  basic_oauth is a Python library that implements the "Resource Owner Password Credentials Grant" as described in http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-4.3

    Why using it?

    The goal of this Grant is to replace the classic "HTTP Basic over SSL" widely used. With Oauth, you exchange your crendentials against a token.

    This mechanism has several advantages:

    * The client does not pass the full credentials for each request.
    * The server does not check the username and password each time, it will only check the access token, this will reduce the database lookups.

    Basic Oauth uses Redis to store the sessions.

    Is it secure?

    __It would be stupid to use this mechanism without SSL__. Even if the token is passed instead of the credentials, the credentials needs to be passed in clear text during the Authentication phase. Also, it can be problematic to lose the token.

    To limit the risk of losing the token, every single token generated is signed using the User-Agent and the client IP address. If an attacker tries to re-use a stolen token, he will have to connect to the same IP and using the same User-Agent (browser version, OS, architecture) to get access. A wrong try will result in destroying the session.

    How to use it?

          import flask
          import basic_oauth

          app = flask.Flask(__name__)

          oauth = basic_oauth.BasicOauth(app)
          oauth.mount_endpoint('login', '/login')
          oauth.mount_endpoint('script', '/js/oauth_client.js')
          oauth.credentials.append(('johndoe', 'foobar42'))

          @app.route('/')
          @oauth.require
          def hello():
              return 'Hello World!'

          if __name__ == '__main__':
              app.debug = True
              app.run()


    Checkout the "example" directory for a complete server/client example.


    Product's homepage

    Requirements:

    · Python
    · Flask
    · redis

      


    TAGS:

    Oauth authentication | Python library | Python | Oauth | authentication

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM