GithubHelp home page GithubHelp logo

fwagner / django-crowd-rest-backend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from linaro/django-crowd-rest-backend

0.0 1.0 0.0 22 KB

Fork of https://bitbucket.org/manuelkoch/django-crowd-rest-backend with fixes and improvements.

Python 100.00%

django-crowd-rest-backend's Introduction

Django authentification backend using Crowd REST API

This is a very rough implementation of a django backend using Crowd's REST API.

It is inspired by the various forks of django-crowd-backend. Those implementations were always using SOUP. This one is just using REST API supported by Crowd. See Atlassian.

Current implementation

  • Connect to Crowd server
  • Authenticate given user by password
  • Sync Django user instance with attributes from Crowd user
  • Setup Djnago user staff/superuser flags based on associated Crowd groups of user

Features

  • HTTPS certificate validation when connecting to secure Crowd url

Missing

  • No handling of SSO cookie

Dependencies

  • just 'urllib2' with a little tweak from VerifiedHTTPS to allow validation of https certificate.

How to use it

  • Edit settings.py to add 'crowdrest' app to your list of apps

  • Adapt configuration settings for crowdrest in settings.py by adding

    whether you want to sync django users from Crowd attributes

      AUTH_CROWD_ALWAYS_UPDATE_USER = True
    

    whether you want to sync django groups from Crowd groups

      AUTH_CROWD_ALWAYS_UPDATE_GROUPS = True
    

    If you use any form of group-based autorization/permission checking, you'd rather have this as True (default). In particular, AUTH_CROWD_STAFF_GROUP & AUTH_CROWD_SUPERUSER_GROUP settings depend on this.

    whether you want to sync all user's Crowd groups into Django

      AUTH_CROWD_CREATE_GROUPS = False
    

    This setting is considered only if AUTH_CROWD_ALWAYS_UPDATE_GROUPS = True. If this is True, then all user's groups in Crowd will be synced to Django (so, effectively, you'll be able to check Crowd group memberships using Django API). If set to False (default), no groups will be created by backend, and only groups already existing in Django will be considered (i.e. user group membership in Django will be updated to intersection of user's Crowd groups and all available Django groups).

    you'd rather have this as True (default). In particular, AUTH_CROWD_STAFF_GROUP & AUTH_CROWD_SUPERUSER_GROUP settings depend on this.

    Django user will get staff flag when Crowd user is in given Crowd group

      AUTH_CROWD_STAFF_GROUP = 'staff'
    

    Django user will get superuser flag when Crowd user is in given Crowd group

      AUTH_CROWD_SUPERUSER_GROUP = 'superuser'
    

    Note that superuser group member does not imply staff membership and vice versa (make sure you read Django docs to understand the difference).

    crowdrest will use this username and password to connect to Crowd server

      AUTH_CROWD_APPLICATION_USER = 'django'
    
      AUTH_CROWD_APPLICATION_PASSWORD = 'django'
    

    URL to Crowd REST API

      AUTH_CROWD_SERVER_REST_URI = 'http://127.0.0.1:8095/crowd/rest/usermanagement/latest'
    

    Use given certificate file to validate https connection to Crowd server

      AUTH_CROWD_SERVER_TRUSTED_ROOT_CERTS_FILE = None
    

    Disable validation of server certificate for https connection to Crowd server (This is a security risk and is not recommended for production environments)

      AUTH_CROWD_SERVER_VALIDATE_CERTIFICATE = False
    

Problems ?

Just send me a message. Let's see if I can help.

License

Use this code as you want. Consider it free. Say thank you. Don't blame me if it doesn't work for you.

django-crowd-rest-backend's People

Contributors

fwagner avatar pfalcon avatar

Watchers

 avatar

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.