wiki:OAuth2Plugin

Version 7 (modified by rjollos, 2 years ago) (diff)

Syntax highlighting.

OAuth2 Authentication Plugin

Description

This is a small OAuth2 plugin intended for use in authenticating against Google. In theory, it should work with other providers too. It currently replaces the existing HTTP authentication, however this is not strictly necessary and can be easily removed.

Requires the oauth2client Python module.

Released into the public domain. For specifics, please see http://unlicense.org/.

Bugs/Feature Requests

Existing bugs and feature requests for OAuth2Plugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out OAuth2Plugin from here using Subversion, or browse the source with Trac.

Installation

  1. Obtain a "client_secrets.json" file. Instructions below assume you are using Google OAuth2.
    1. Creating a new project here.
    2. Under "APIS & AUTH" click "Credentials" and then "Create new Client ID."
    3. Select "Web application"
    4. For Javascript origins, set the address of your server (ex: https://example.com/).
    5. For redirect URI, set the path to your Trac project followed by oauth2callback (ex.: https://example.com/trac/myproject/oauth2callback).
    6. Under the newly created client ID section, click "Download JSON."
  1. Drop the plugin in your plugins directory.
  2. In your configuration section, disable the http authentication. Then specify the location of "client_secrets.json."
[components]
trac.web.auth.loginmodule = disabled

[oauth2]
secrets = /path/to/client_secrets.json
  1. Optionally, if you would like to restrict access to a particular Google Apps domain, add the following.

{{{!ini [oauth2] domain = my.google.apps.domain }}}

Recent Changes

14010 by ysobolev on 2014-07-20 01:25:04
Added unlicense.
14009 by ysobolev on 2014-07-20 00:22:48
Initial commit.
14008 by ysobolev on 2014-07-20 00:10:21
New hack OAuth2Plugin, created by ysobolev
(more)

Author/Contributors

Author: ysobolev
Maintainer: Yury Sobolev
Contributors: