Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Initial commit; code imported from repoze.who.plugins.macauth.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfk committed Jun 15, 2012
0 parents commit b3d8561
Show file tree
Hide file tree
Showing 7 changed files with 810 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.pyc
*.egg-info
*.swp
.coverage
*~
build
dist
htmlcov
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0.1.0 - 2012-06-15
==================

* Initial release; based on repoze.who.plugins.macauth codebase.

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include CHANGES.txt
include README.rst
43 changes: 43 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
===============
pyramid_macauth
===============

This is a Pyramid authenitcation plugin for MAC Access Authentication:

http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01

To access resources using MAC Access Authentication, the client must have
obtained a set of MAC credentials including an id and secret key. They use
these credentials to make signed requests to the server.

When accessing a protected resource, the server will generate a 401 challenge
response with the scheme "MAC" as follows::

> GET /protected_resource HTTP/1.1
> Host: example.com

< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: MAC

The client will use their MAC credentials to build a request signature and
include it in the Authorization header like so::

> GET /protected_resource HTTP/1.1
> Host: example.com
> Authorization: MAC id="h480djs93hd8",
> ts="1336363200",
> nonce="dj83hs9s",
> mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="

< HTTP/1.1 200 OK
< Content-Type: text/plain
<
< For your eyes only: secret data!


This plugin uses the tokenlib library for verifying MAC credentials:

https://github.com/mozilla-services/tokenlib

If this library does not meet your needs, you can provide a custom callback
function to decode the MAC id token.
Loading

0 comments on commit b3d8561

Please sign in to comment.