Difference between revisions of "Design Specs: Authorization and Authentication"

From WormBaseWiki
Jump to navigationJump to search
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Objectives==
+
= Objectives =
  
 
This element will need to work with the core code of the web
 
This element will need to work with the core code of the web
 
application to implement user authorization and authentication.
 
application to implement user authorization and authentication.
 
Catalyst has great support for this already, but we will also need to
 
Catalyst has great support for this already, but we will also need to
build a user database for enabling greater customizability.
+
build a user database for enabling greater customizability.  
  
 
Is customization mainly for GBrowse?
 
Is customization mainly for GBrowse?
 
Are there any data that should not be available to public?
 
Are there any data that should not be available to public?
  
 +
customization: user can store a specific object eg. sequence,
  
 
1. Users will be able to create new accounts, or log in to the system using an Open ID
 
1. Users will be able to create new accounts, or log in to the system using an Open ID
Line 14: Line 15:
 
2. User preferences will be stored in a back-end database...
 
2. User preferences will be stored in a back-end database...
  
==Gbrowse Compatibility==
 
  
Gbrowse2 user registration and login system
+
different ways to do this
  
An optional user registration and login system allows users to register stable GBrowse accounts and to keep their settings and custom tracks when they move from one computer to another.
+
1. Catalyst simple login ; cookies; session management
  
http://gmod.org/wiki/GBrowse_2.0_HOWTO#Configuring_the_User_Account_Database
+
2. advantages and disadvantage of using those modules
  
Installing the necessary Perl modules
+
= Gbrowse Compatibility =
  
The login module needs to process OpenID transactions. It also needs to send outgoing email, which nowadays frequently requires authentication between the GBrowse web server host and the mail hub. The following additional libraries and modules are required for basic functionality:
+
Gbrowse2 user registration and login system
  
;'''Digest::SHA1'''
+
An optional user registration and login system allows users to register stable GBrowse accounts and to keep their settings and custom tracks when they move from one computer to another.
:For creating and storing passwords. Available from [http://www.cpan.org CPAN] or as Debian package or as Debian package libdigest-sha1-perl.
 
  
;'''Crypt::SSLeay'''
+
http://gmod.org/wiki/GBrowse_2.0_HOWTO#Configuring_the_User_Account_Database
:For OpenID authentication. Available from [http://www.cpan.org CPAN] or as Debian package libcrypt-ssleay-perl. This module in turn requires the [http://www.openssl.org/ OpenSSL package], Debian package ''libssl-dev''.
+
 
 
;'''Math::BigInt::Pari''' or '''Math::BigInt::GMP'''
 
:These libraries speed up Net::OpenID::Consumer, and in particular reduce the time needed to run the Net::OpenID::Consumer tests. To use the Pari module you will first need to install libpari (http://pari.math.u-bordeaux.fr/).To use GMP install libGMP (http://gmplib.org/). Debian users can simply install ''libmath-bigint-gmp-perl''.
 
 
 
;'''Net::OpenID::Consumer'''
 
:For OpenID authentication. Available from [http://www.cpan.org CPAN] or as Debian package ''libnet-openid-consumer-perl''.
 
 
 
If your preferred mail server requires user authentication to forward outgoing mail, then you will also need the following two modules:
 
 
 
;'''Net::SMTP::SSL'''
 
:Encrypted connections to mail servers. Available from [http://www.cpan.org CPAN] or as Debian package ''libnet-smtp-ssl-perl''.
 
 
 
;'''Authen::SASL'''
 
:Handle the authentication between mail client and server. Available from [http://www.cpan.org CPAN] or as Debian package ''libauthen-sasl-per''l.
 
  
== To Explore ==
+
= To Explore =
  
 
Catalyst::Plugin::Authentication
 
Catalyst::Plugin::Authentication
Line 65: Line 50:
 
This module might also be useful:
 
This module might also be useful:
 
  Catalyst::Extension::SimpleLogin
 
  Catalyst::Extension::SimpleLogin
 +
 +
= Deployment =
 +
 +
== Database ==
 +
*build a mysql database, currently called "wormbase_user" on dev machine with username: wb , no password
 +
*create four tables: SQL file is under /util/sql/user_login.sql
 +
<pre>    CREATE TABLE users (
 +
            id            INTEGER PRIMARY KEY,
 +
            username      TEXT,
 +
            password      TEXT,
 +
            email_address TEXT,
 +
            first_name    TEXT,
 +
            last_name    TEXT,
 +
    );
 +
    CREATE TABLE roles (
 +
            id  INTEGER PRIMARY KEY,
 +
            role TEXT
 +
    );
 +
    CREATE TABLE users_to_roles (
 +
            user_id INTEGER,
 +
            role_id INTEGER,
 +
            PRIMARY KEY (user_id, role_id)
 +
    );
 +
    CREATE TABLE openid (
 +
            openid_url TEXT PRIMARY KEY,
 +
            user_id_id INTEGER
 +
    );
 +
</pre>
 +
 +
== Module Requirements ==
 +
* first install Math::BigInt::GMP which will require to install the gmp libaray
 +
(on unbuntu/debian do: sudo apt-get install libgmp3-dev)
 +
* second install Catalyst::Authentication::Credential::OpenID
 +
* third install Crypt::SSLeay
 +
 +
 +
[[Category:Developer documentation]]

Latest revision as of 16:55, 4 November 2010

Objectives

This element will need to work with the core code of the web application to implement user authorization and authentication. Catalyst has great support for this already, but we will also need to build a user database for enabling greater customizability.

Is customization mainly for GBrowse? Are there any data that should not be available to public?

customization: user can store a specific object eg. sequence,

1. Users will be able to create new accounts, or log in to the system using an Open ID

2. User preferences will be stored in a back-end database...


different ways to do this

1. Catalyst simple login ; cookies; session management

2. advantages and disadvantage of using those modules

Gbrowse Compatibility

Gbrowse2 user registration and login system

An optional user registration and login system allows users to register stable GBrowse accounts and to keep their settings and custom tracks when they move from one computer to another.

http://gmod.org/wiki/GBrowse_2.0_HOWTO#Configuring_the_User_Account_Database


To Explore

Catalyst::Plugin::Authentication

http://search.cpan.org/~flora/Catalyst-Plugin-Authentication-0.10016/lib/Catalyst/Plugin/Authentication.pm

And for Credential verification:

http://search.cpan.org/perldoc?Catalyst%3A%3AAuthentication%3A%3ACredential%3A%3AOpenID

Here are some docs on Auth/Auth:

http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::05_Authentication


Catalyst Tutorial on Authentication: http://www.catalystframework.org/calendar/2008/19

This module might also be useful:

Catalyst::Extension::SimpleLogin

Deployment

Database

  • build a mysql database, currently called "wormbase_user" on dev machine with username: wb , no password
  • create four tables: SQL file is under /util/sql/user_login.sql
    CREATE TABLE users (
            id            INTEGER PRIMARY KEY,
            username      TEXT,
            password      TEXT,
            email_address TEXT,
            first_name    TEXT,
            last_name     TEXT,
    );
    CREATE TABLE roles (
            id   INTEGER PRIMARY KEY,
            role TEXT
    );
    CREATE TABLE users_to_roles (
            user_id INTEGER,
            role_id INTEGER,
            PRIMARY KEY (user_id, role_id)
    );
    CREATE TABLE openid (
            openid_url TEXT PRIMARY KEY,
            user_id_id INTEGER
    );

Module Requirements

  • first install Math::BigInt::GMP which will require to install the gmp libaray

(on unbuntu/debian do: sudo apt-get install libgmp3-dev)

  • second install Catalyst::Authentication::Credential::OpenID
  • third install Crypt::SSLeay