Project

Profile

Help

How to connect?
Download (2.34 KB) Statistics
| Branch: | Revision:

rails-demo / README.md @ master

OAuth 2 Client Application Demo for Redmine

A simple Rails application to demonstrate use of the omniauth-redmine-oauth2 gem for connecting to Redmine.

For now, you will have to apply this patch to your Redmine to turn it into an OAuth2 provider. Or, try it out with your Planio account - Planio has the OAuth 2 support already built in!

Running the Demo

The application is a simple, database-less Rails 6 app which will display a list of your most recent issues from Redmine. In order to get started, check out the code and run bundle install. Any Ruby >= 2.4, < 3.0 should work.

Next, create an OAuth application in your Planio or patched Redmine. Use http://localhost:3000/auth/redmine_oauth2/callback as the redirect URI and assign it the View Issues scope. After saving, take note of the application id and secret.

Now fire up the rails app, passing the id, secret and the base URL of the Redmine site you want to connect to:

REDMINE_APP_ID=lenghtyrandomstring \
REDMINE_APP_SECRET=anotherlengthyrandomstring \
REDMINE_HOST=https://your-account.plan.io \
bin/rails server

That's it! Now point your browser to http://localhost:3000/ and click Sign in to Redmine.

License

Copyright (c) 2020 by Jens Kraemer, Planio GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

(5-5/7)