Coder Social home page Coder Social logo

ckanext-persona's Introduction

ckanext-persona

A CKAN extension that lets users login to your CKAN site using Mozilla Persona. Users can login using just their existing email address, without having to create a new user name and password for CKAN.

Traditional username and password login and registration are still enabled when this plugin is active, the user is given the choice of Persona or traditional login.

For screenshots and details about how it works, see the blog post.

Installation

ckanext-persona has been tested against that CKAN 2.3 development version.

To install, activate your CKAN virtualenv and then do:

git clone 'https://github.co/mseanh/ckanext-persona.git'
cd ckanext-persona
python setup.py develop

Then add 'persona' to the ckan.plugins line in your CKAN config file, for example:

ckan.plugins = resource_proxy stats datastore persona

Also make sure you have ckan.site_url set correctly in your config file, for example:

ckan.site_url = http://scotdata.ckan.net

Finally, restart your web server.

Todo

There's a few things that need to be done before this plugin is ready for production use, including:

  • Handle multiple users with the same email address in CKAN: show all the accounts to the user, and ask her which one she wants to login to (currently it will crash if it finds an email address with multiple users)
  • Generate better unique user names based on emails (e.g. first half of email, with a random number appended if necessary)
  • Give the user a chance to change the generated username before their account is created
  • Verify SSL certificates (or is requests already doing this?)
  • Implement CSRF protection
  • Tests, Mozilla recommend Selenium for this
  • Better error handling when verification fails
  • Implement logging-in via Persona without JavaScript

There are also some changes to CKAN core that would be nice to have:

  • Allow passwordless accounts in CKAN, so this plugin doesn't have to generate passwords that will never be used ckan/ckan#1459
  • Allow users to have multiple email addresses in CKAN, and verify those addresses using Persona:
    https://developer.mozilla.org/en-US/Persona/The_implementor_s_guide/Adding_extra_email_addresses_with_Persona
  • Add an API function to CKAN for searching for users by email, so this plugin doesn't need to access CKAN's model directly to do it
  • Tweak the templates in CKAN that this plugin overrides, we need a couple of new template blocks on the login and register pages in CKAN so that his plugin doesn't need to duplicate template code from core

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.