Skip to content

Commit

Permalink
Back to development, added pyramid_ldap support (production), buildou…
Browse files Browse the repository at this point in the history
…t deployment config.
  • Loading branch information
sneridagh committed Apr 5, 2013
1 parent c50333a commit 34e62b9
Show file tree
Hide file tree
Showing 9 changed files with 534 additions and 46 deletions.
48 changes: 43 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
*.db
*.log
*.pyc
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
*.DS_Store
.codeintel
dist
build
eggs
var
parts
bin
sdist
develop-eggs
production
.installed.cfg
lib
lib64

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

config/nginx*
config/*.ini
config/ssl
downloads
.max_settings
src
.DS_Store
64 changes: 49 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
Introduction
============

Osiris (/oʊˈsaɪərɨs/) is an Egyptian god, usually identified as the god of the afterlife, the underworld and the dead. He is classically depicted as a green-skinned man with a pharaoh's beard, partially mummy-wrapped at the legs, wearing a distinctive crown with two large ostrich feathers at either side, and holding a symbolic crook and flail. Osiris was the afterlife's judge, he weighed the dead souls and compare them with the Feather of Truth. Those which weighed the most were sent to Ammut (the soul devourer) and not heavy enough to Aaru (the egyptian paradise).

Osiris is an oAuth 2.0 (draft 22) compliant server based on Pyramid. The current version (1.0) it supports the `resource owner password credentials` authentication flow. It uses pyramid_who as user backend providing the way to behave as an oAuth authentication gateway. This means that you can use your authentication backend (LDAP, SQL, etc.) oAuth enabled with Osiris. Osiris uses a pluggable store factory to store the issued token information. The current version includes the MongoDB one.
Osiris (/oʊˈsaɪərɨs/) is an Egyptian god, usually identified as the god of the
afterlife, the underworld and the dead. He is classically depicted as a green-
skinned man with a pharaoh's beard, partially mummy-wrapped at the legs, wearing
a distinctive crown with two large ostrich feathers at either side, and holding
a symbolic crook and flail. Osiris was the afterlife's judge, he weighed the
dead souls and compare them with the Feather of Truth. Those which weighed the
most were sent to Ammut (the soul devourer) and not heavy enough to Aaru (the
egyptian paradise).

Osiris is an oAuth 2.0 (draft 22) compliant server based on Pyramid. The current
version (1.0) it supports the `resource owner password credentials`
authentication flow. It uses pyramid_who as user backend providing the way to
behave as an oAuth authentication gateway. This means that you can use your
authentication backend (LDAP, SQL, etc.) oAuth enabled with Osiris. Osiris uses
a pluggable store factory to store the issued token information. The current
version includes the MongoDB one.

The `resource owner password credentials` flow
==============================================

This flow is not the most popular oAuth flow, but it's useful in case that we want to oAuth enable an app or a set of apps in an scenario with an already existing user backend. Using this flow you can use Osiris as a gateway between your existing user store and oAuth enable it. Osiris will authenticate the user credentials against your user store and if suceeds it will issue a oAuth token. Then, an app can use it to impersonate the user's token to access an oAuth enabled REST API, for example.
This flow is not the most popular oAuth flow, but it's useful in case that we
want to oAuth enable an app or a set of apps in an scenario with an already
existing user backend. Using this flow you can use Osiris as a gateway between
your existing user store and oAuth enable it. Osiris will authenticate the user
credentials against your user store and if suceeds it will issue a oAuth token.
Then, an app can use it to impersonate the user's token to access an oAuth
enabled REST API, for example.

For that reason and out of the oAuth specification, Osiris features an additional endpoint to allow remote applications and resource servers to check previously issued tokens and users and validate it. This endpoint will respond if the token is valid for the user specified and if the token is not expired or revoked.
For that reason and out of the oAuth specification, Osiris features an
additional endpoint to allow remote applications and resource servers to check
previously issued tokens and users and validate it. This endpoint will respond
if the token is valid for the user specified and if the token is not expired or
revoked.

You can use Osiris as a standalone application or use it as a Pyramid plugin and make your app Osiris enabled.
You can use Osiris as a standalone application or use it as a Pyramid plugin and
make your app Osiris enabled.

Setup
=====

This is the configuration to use it as a standalone Pyramid app, along with your own one using Paste urlmap in your app .ini::
This is the configuration to use it as a standalone Pyramid app, along with your
own one using Paste urlmap in your app .ini::

[server:main]
use = egg:Paste#http
Expand Down Expand Up @@ -90,12 +115,14 @@ osiris.whoconfig
REST API for `resource owner password credentials` flow
=======================================================

Following the oAuth 2.0 authentication standard (draft 22), the `Resource owner password credentials` flow must implement this web services and use these parameters:
Following the oAuth 2.0 authentication standard (draft 22), the `Resource owner
password credentials` flow must implement this web services and use these
parameters:

/token
Method:
POST

Params:
grant_type
Required. Value must be set to password
Expand Down Expand Up @@ -126,7 +153,7 @@ Following the oAuth 2.0 authentication standard (draft 22), the `Resource owner
/checktoken
Method:
POST

Params:
access_token
Required. Value of the token to be checked
Expand All @@ -141,18 +168,25 @@ Following the oAuth 2.0 authentication standard (draft 22), the `Resource owner
application/x-www-form-urlencoded

Response:
If successful: HTTP/1.1 200 OK
If successful: HTTP/1.1 200 OK
If not successful: HTTP/1.1 401 Unauthorized

To do
=====

Osiris features only one oAuth 2.0 authentication flow, the `Resource owner password credentials`. It's ready to accomodate the remaining flows defined by oAuth 2.0. A similar case happens with the available storage backends. The current version sports only the MongoDB storage but Osiris support the use of a plugin storage model and can accomodate more storage types.
Osiris features only one oAuth 2.0 authentication flow: the `Resource owner
password credentials` (http://tools.ietf.org/html/rfc6749#section-4.3). It's
ready to accomodate the remaining flows defined by oAuth 2.0. A similar case
happens with the available storage backends. The current version sports only the
MongoDB storage but Osiris support the use of a plugin storage model and can
accomodate more storage types.

Of course, any contribution is welcome. Please, feel free to contribute with your own storage plugins and help implementing the remaining oAuth flows.
Of course, any contribution is welcome. Please, feel free to contribute with
your own storage plugins and help implementing the remaining oAuth flows.

Credits
=======

Pluggable store factory inspired by Ben Bangert's Velruse (https://github.com/bbangert/velruse).
Borrowed error handling from pyramid-oauth2 (http://code.google.com/p/pyramid-oauth2/) by Kevin Van Wilder et al.
Pluggable store factory inspired by Ben Bangert's Velruse
(https://github.com/bbangert/velruse). Borrowed error handling from pyramid-
oauth2 (http://code.google.com/p/pyramid-oauth2/) by Kevin Van Wilder et al.
Loading

0 comments on commit 34e62b9

Please sign in to comment.