Public | Automated Build

Last pushed: 10 hours ago
Short Description
Node.js implementation for the oauth2-authentification process of the o2r web api
Full Description

o2r bouncer

Node.js implementation for the oauth2-authentification process of the o2r web api


  • nodejs >= 6.2
  • npm


This project includes a Dockerfile which can be built with

docker build -t o2r-bouncer .

The image can then be run and configured via environment variables. For convenience, we include a docker-compose configuration, which can be run with

cd docker-compose && docker-compose up
# after you're done, shutdown and delete all volumes (data):
docker-compose down -v

Available environment variables

    Define on which Port muncher should listen. Defaults to 8083.
    Location for the mongo db. Defaults to mongodb://localhost/. You will very likely need to change this.
    Which database inside the mongo db should be used. Defaults to muncher.
    Authorization URL for the ORCiD OAuth2 API. Defaults to
    Token URL for the ORCiD OAuth2 API. Defaults to
    Scope for the ORCiD API. Defaults to /authenticate.
  • OAUTH_CLIENT_ID Required
    The client ID for your instance.
    The client secret for your instance.
  • http_proxy Required
    HTTP(S) Proxy used for the OAuth process. This will be needed if your server is behind a proxy/firewall.
    Authentication token for a bot app on Slack. See section Slack bot.
    Token provided by Slack for interative messages and events, to be used to verify that requests are actually coming from Slack.
    Channel to post status messages to, defaults to #monitoring.
    Channel to post messages on user events, defaults to #monitoring.
    A regex to check Slack usernames, which are allowed to react to interactive messages. Defaults to .* and the created regex is always case _in_sensitive. To allow specific users only, use e.g. \\b(claerbout|peng|stodden)\\b (case insensitive match of full words claerbout, peng, stodden).

Generating the client ID & secret

See the ORCiD Guide. As a redirect URI you need to set the path /api/v1/auth/login, relative to your base url. We highly recommend using https. The client ID & secret then need to be provided as environment variables or directly saved to the config/config.js file.

Slack bot

Documentation of Slack API:, especially interactive messages.

The bot needs the permissions to join channels and post to them.
Add the following scopes to the app in the section "OAuth & Permissions" in the bot's apps page.

  • channels:write
  • chat:write:bot
  • incoming-webhook
  • bot

While adding the app to your Slack organisation, make sure to allow the bot to post the the desired channel.

In the o2r bot app's configuration page for Interactive Messages on Slack, enter the following endpoints:

Local bot development

Start ngrok with ngrok http 8083 and enter the public endpoint pointing to your local server at ngrok also has a useful web interface at on all incoming requests.


You must provide the required settings as environment variables, either at start time or via the debug configuration of your IDE.

To start bouncer with the required environment replace the respective settings with the actual values (check your ORCiD page) and execute the following command.


You can then start the authentication process by opening http://localhost:8083/api/v1/auth/login and see who you are afterwards at http://localhost:8083/api/v1/auth/whoami.


o2r bouncer is licensed under Apache License, Version 2.0, see file LICENSE.

Copyright (C) 2016 - o2r project.

Docker Pull Command
Source Repository

Comments (0)