[[PageOutline(2-5,Contents,pullout)]] = 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 [report:9?COMPONENT=OAuth2Plugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=OAuth2Plugin&owner=ysobolev new ticket]. == Download Download the zipped source from [export:oauth2plugin here]. == Source You can check out OAuth2Plugin from [http://trac-hacks.org/svn/oauth2plugin here] using Subversion, or [source:oauth2plugin browse the source] with Trac. == Installation 1. Obtain a "client_secrets.json" file. Instructions below assume you are using Google OAuth2. a. Creating a new project [https://console.developers.google.com/ here]. b. Under "APIS & AUTH" click "Credentials" and then "Create new Client ID." c. Select "Web application" d. For Javascript origins, set the address of your server (ex: https://example.com/). e. For redirect URI, set the path to your Trac project followed by oauth2callback (ex.: https://example.com/trac/myproject/oauth2callback). f. Under the newly created client ID section, click "Download JSON." 2. Drop the plugin in your plugins directory. 3. In your configuration section, disable the http authentication. Then specify the location of "client_secrets.json." {{{#!ini [components] trac.web.auth.loginmodule = disabled [oauth2] secrets = /path/to/client_secrets.json }}} 4. 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 [[ChangeLog(oauth2plugin, 3)]] == !Author/Contributors **Author:** [wiki:ysobolev] [[BR]] **Maintainer:** [[Maintainer]] [[BR]] **Contributors:**