StyleShare/wsgi-oauth2 — pull request #4 by secretmike (2013-04-12 15:06:10+00:00)
Title: Add option to limit access based on Github Organizations

Adds an option to the `GithubService` to limit access based on a user's Github Organizations.

Example usage:
```python
from wsgioauth2 import GithubService
# allowed_orgs can be a single string or a list of strings
github = GithubService(allowed_orgs=("mycompany"))
client = github.make_client(client_id="...", client_secret="...")
application = client.wsgi_middleware(application, secret="...", path="yoyo")
```

Anybody who authenticates with GitHub but is NOT a member of one of the listed organizations will get a `403 Forbidden` page.

The default `403 Forbidden` page is ugly so this also adds the option to allow the Forbidden url to be passed into the protected application so it can be styled.

Example with custom Forbidden page:
```python
from wsgioauth2 import GithubService
github = GithubService(allowed_orgs=("mycompany"))
client = github.make_client(client_id="...", client_secret="...")
application = client.wsgi_middleware(application, secret="...", path="yoyo",
forbidden_path="/denied", forbidden_passthrough=True)
```