Git Product home page Git Product logo

kotti_accounts's Introduction

kotti_accounts is a Kotti plugin which allows a user principal to be associated to multiple email accounts.

Find out more about Kotti

For the impatient

There's a demo which shows how it works. Just run the commands below inside a clean virtualenv.

git clone https://github.com/frgomes/kotti_velruse_demo.git
cd kotti_velruse_demo
./run-server.sh

Setup

  1. Insert kotti_accounts.kotti_configure on kotti.configurators
kotti.configurators = kotti_velruse.kotti_configure
                      kotti_accounts.kotti_configure
                      # other plugins...
  1. See also kotti_velruse for other configurations, since kotti_velruse and kotti_accounts were designed to work together.

Design Decisions

  • associate multiple externally authenticated identities to a single Principal.
  • substitute part of the internal registration workflow provided by kotti.security.
  • behave as a drop-in to the existing kotti.security Principals.
  • all existing test cases depending on Principals must pass.
  • integrate with kotti_velruse via events.

Workflow

New user

The actions enumerated below happen when a user authenticates for the first time using his/her external OpenID account (or any other authentication method):

  • the user's real name and email address are obtained from the external provider;
  • a new Principal is created and populated with the real name and email address;
  • a new Account is created and populated with the email address;
  • the newly created Account is associated with the newly created Principal;
  • event UserSelfRegistered is triggered, in order to integrate with other plugins.
  • the session is then authenticated with the allocated Principal.

Returning user

These actions enumerated below happen when a returning user authenticates:

  • the user's real name and email address are obtained from the external provider;
  • find the Account which matches the email address;
  • finds the Principal associated with the Account;
  • the session is then authenticated with the Principal found.

Add email to existing user

These actions enumerated below happen when new email addresses are added to an existing Principal, using the new Preferences page:

  • the user remains authenticated as he/she was, keeping the current Principal;
  • the user performs a new login, authenticates against another external provider;
  • the user's real name and email address are obtained from the external provider;
  • a new Account is created and populated with the email address; the real name is discarded;
  • the newly created Account is associated with the existing created Principal;
  • the session remains authenticated as it was in the beginning.

Pending

  • (TODO) ability to merge accounts.

Troubleshooting

How do I authenticate as administrator?

The default authentication method provided by Kotti retrieves Principals from the database and compares the password you type against what is stored there. The authentication method provided by kotti_accounts relies on authentication performed by external providers, which means that the usual admin/qwerty is not valid anymore.

The way to become administrator consists on these steps:

  • Insert something similar to the below into your configuration file:
kotti.accounts.admins = [email protected]
                        [email protected]

Note

This allows the specified list of emails to be understood as special. It means that administrator rights will be automatically assigned only at Principal creation, which happens when the user authenticates for the first time.

  • Start the server and authenticate using some external provider, employing any of the emails listed as part of kotti.accounts.admins.
  • Stop the server
  • Remove the configuration you just done on kotti.accounts.admins.

Warning

In order to enforce security, it's a good practice to remove kotti.accounts.admins from your configuration.

  • Start the server

When you login to your previously created user account, using an external provider, you will be recognized as administrator.

Support

Please find links on the top of this page.

kotti_accounts's People

Contributors

frgomes avatar tiberiuichim avatar

Stargazers

Joseph Rawson avatar

Watchers

 avatar

Forkers

umeboshi2

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.