GithubHelp home page GithubHelp logo

dheerendrarathor / ldap-oauth2 Goto Github PK

View Code? Open in Web Editor NEW
66.0 13.0 28.0 2.26 MB

OAuth implementation over IITB LDAP authentication system

Home Page: http://gymkhana.iitb.ac.in/sso/

License: GNU General Public License v3.0

Python 62.10% CSS 2.31% JavaScript 6.10% HTML 28.87% Shell 0.62%
iitb oauth2 oauth2-server sso ldap

ldap-oauth2's Introduction

Code Health Build Status Requirements Status Coverage Status

OAUTH 2.0 Provider for LDAP

This application follows the standard OAuth2.0 flow described in RFC 6749

Detailed documentation is present at: https://gymkhana.iitb.ac.in/sso/doc/

Special Feature

  • Selective Permissions option for users (like facebook)
  • Atomic Permissions for fields

URLs:

All URLs are from base of application URL. (i.e. assuming application is installed at '/')

  • Application Registration /oauth/applications/
  • Authorization /oauth/authorize/
  • Get Access Token /oauth/token/
  • Revoke Token /oauth/revoke_token/

Scopes:

  • basic: Know who you are on SSO
  • profile: Your first name and last name
  • picture: Profile Picture
  • ldap: Your ldap username and email
  • phone: Your contact number including additional numbers
  • insti_address: Your address inside institute
  • program: Your roll number, department, course, joining year and graduation year
  • secondary_emails: Your alternate emails
  • send_mail: Send you mail on behalf of application

User Resources:

  • /user/api/user/: Get basic information corresponding to basic scope
  • /user/api/user/?fields=field1,field2: Get additional information corresponding to field1 and field2. See available fields below

Fields:

Field Name: Required Scopes

  • first_name: profile
  • last_name: profile
  • profile_picture: profile picture
  • username: ldap
  • email: ldap
  • mobile: phone
  • roll_number: program
  • contacts: phone
  • insti_address: insti_address
  • program: program
  • secondary_emails: secondary_emails

TODO:

  • Atomize permissions
  • Add endpoint to send email on behalf of app
  • Create Login with SSO widgets
  • 
    

ldap-oauth2's People

Contributors

bijoysingh avatar dheerendrarathor avatar prateekchandan avatar tareko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ldap-oauth2's Issues

Error : Not all permissions provided

Hi,

I am able to succesfully login and provided necessary permissions (basic profile ldap phone). However, I am getting Not all permissions provided error. I am retrieving array('username', 'email', 'first_name', 'last_name') .
Could you help where I am not able to provide full permissions ?

Thanks,
Ayush

Error Message shown below

On CMS login page - I found that error mesg is displayed on the footer - "Hostel information not present".
Only after 10~ attempts of login I figured out that there it needs my Hostel Info.
Make it better. show the error on top & take us to the page to enter details directly

Pattern Problem

Hey,
I want create a own LDPA Auth for my own Server.

Python 2/3 push this error....

File "/usr/local/lib/python3.6/dist-packages/django/urls/resolvers.py", line 398, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/projects/ldap-oauth2/sso/urls.py", line 18, in <module> import oauth2_provider.urls File "/usr/local/lib/python3.6/dist-packages/oauth2_provider/urls.py", line 2, in <module> from django.conf.urls import patterns, url ImportError: cannot import name 'patterns'

Regarding webpage not opening properly

After I sign into IITB CMS, it goes to a blank page.
It only has two texts on the entire page, Menu and full form of CMS at the top.
Rest of the page is empty.
Kindly check.
Thank you.

Feature Request

The widget should allow passing a parameter for changing the color of the button.
This is essential as it allows the various bodies to customize the buttons to match their interfaces.
Additional could be allow passing an entire CSS file

ValueError when using Django (1.8)

Hi Dheerendra,

Newly installed according to Installation Guidelines, when I open the root URL in my browser, HTTP 500 respond, below is the Traceback:

#( 04/17/17@ 1:40PM )( ubuntu@ubuntu ):/tmp/venv_test/ldap-oauth2@master✔
python manage.py runserver 0.0.0.0:7777
Performing system checks...

System check identified no issues (0 silenced).
April 17, 2017 - 11:10:45
Django version 1.8, using settings 'sso.settings'
Starting development server at http://0.0.0.0:7777/
Quit the server with CONTROL-C.
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 189, in call
response = self.get_response(request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 218, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 268, in handle_uncaught_exception
return callback(request, **param_dict)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 110, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/defaults.py", line 45, in server_error
return http.HttpResponseServerError(template.render())
File "/usr/local/lib/python2.7/dist-packages/django/template/backends/django.py", line 74, in render
return self.template.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 209, in render
return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 201, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 903, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 917, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 135, in render
return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 201, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 903, in render
bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 917, in render_node
return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/templatetags/static.py", line 105, in render
url = self.url(context)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/templatetags/staticfiles.py", line 16, in url
return static(path)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/templatetags/staticfiles.py", line 9, in static
return staticfiles_storage.url(path)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py", line 131, in url
hashed_name = self.stored_name(clean_name)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py", line 280, in stored_name
cache_name = self.clean_name(self.hashed_name(name))
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py", line 94, in hashed_name
(clean_name, self))
ValueError: The file 'sso/css/bootstrap.min.css' could not be found with <django.contrib.staticfiles.storage.CachedStaticFilesStorage object at 0x7fd5a960bdd0>.
[17/Apr/2017 11:11:10]"GET /account/login/ HTTP/1.1" 500 59

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.