Project

Profile

Help

Statistics
| Branch: | Revision:
How to connect?

root @ master

Name Size
  lib
  public
  views
.gitignore 7 Bytes
Gemfile 83 Bytes
Gemfile.lock 883 Bytes
README.md 2.53 KB
config.ru 107 Bytes
doorkeeper_client.rb 2.2 KB

Doorkeeper Sinatra Client

This app is an example of OAuth 2 client. It was built in order to test the Redmine OAuth2 Server. It uses oauth2 and sinatra gems. Check out the live app here. The source code is available on Planio.

About Doorkeeper Gem

For more information about the gem, documentation, wiki and another resources, check out the project on GitHub.

Installation

First clone the repository from Planio:

git clone https://support.plan.io/support/redmine-oauth2-client.git

Install all dependencies with:

bundle install

Configuration

Client application

If you have your own provider, you'll need to create a new client for this application. Make sure to append the /callback to the redirect uri (e.g. http://localhost:9292/callback).

Ngrok

If you'd like to use the Redmine OAuth2 Test Server with your own app, consider using Ngrok to establish an SSL tunnel to your local machine:

ngrok http 9292

Then, use your Ngrok URL (e.g. https://6b1b079e.ngrok.io/callback) as the redirect uri.

Environment variables

You need to setup few environment variables in order to make the client work. You can either set the variables in you environment:

export OAUTH2_CLIENT_ID           = "129477f..."
export OAUTH2_CLIENT_SECRET       = "c1eec90..."
export OAUTH2_CLIENT_REDIRECT_URI = "http://localhost:9292/callback" # or use your ngrok url
export SITE                       = "http://localhost:3000"          # or use https://server.redmine-oauth.planio.org

or set them in a file named env.rb in the app's root. This file is loaded automatically by the app.

# env.rb
ENV['OAUTH2_CLIENT_ID']           = "129477f..."
ENV['OAUTH2_CLIENT_SECRET']       = "c1eec90..."
ENV['OAUTH2_CLIENT_REDIRECT_URI'] = "http://localhost:9292/callback" # or use your ngrok url
ENV['SITE']                       = "http://localhost:3000"          # or use https://server.redmine-oauth.planio.org

Start the server

Fire up the server with:

rackup config.ru

View all revisions | View revisions

Also available in: Atom