rabbitmq-server/deps/rabbitmq_auth_backend_oauth2
Michael Klishin ae77becec7 Update README.md 2016-01-21 14:29:02 +03:00
..
src Indent 2016-01-20 14:24:06 +00:00
test/src Indent 2016-01-20 14:24:06 +00:00
.gitignore Init. Make request to /check_token 2016-01-15 14:50:21 +00:00
.travis.yml Init. Make request to /check_token 2016-01-15 14:50:21 +00:00
Makefile Tests 2016-01-20 14:04:14 +00:00
README.md Update README.md 2016-01-21 14:29:02 +03:00
build.config Init. Make request to /check_token 2016-01-15 14:50:21 +00:00
erlang.mk Init. Make request to /check_token 2016-01-15 14:50:21 +00:00
rabbitmq-components.mk Init. Make request to /check_token 2016-01-15 14:50:21 +00:00

README.md

Rabbitmq auth backend to use with Cloud Foundry UAA

Allows to use access tokens provided by CF UAA to authorize in RabbitMQ. Make requests to /check_token endpoint on UAA server. See https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-APIs.rst#id32

Usage

First, enable the plugin. Then, configure access to UAA:

{rabbitmq_auth_backend_uaa,
  [{uri,      <<"https://your-uaa-server">>},
   {username, <<"uaa-client-id">>},
   {password, <<"uaa-client-secret">>},
   {resource_server_id, <<"your-resource-server-id"}]}
   

where

  • your-uaa-server is a UAA server host
  • uaa-client-id is a UAA client ID
  • uaa-client-secret is the shared secret
  • your-resource-server-id is a resource server ID (e.g. 'rabbitmq')

To learn more about UAA/OAuth 2 clients, see UAA docs.

Then you can use access_tokens acquired from UAA as username to authenticate in RabbitMQ.

Scopes

Note: scopes is a subject to change, the current implementation provides limited flexibility.

Current scope format is <vhost>_<kind>_<permission>_<name>, where

  • <vhost> is resource vhost
  • <kind>: q for queue, ex for exchange, or t for topic
  • <permission> is an access permission (configure, read, or write)
  • <name> is an exact resource name (no regular expressions are supported)

The scopes implementation is shared with the RabbitMQ OAuth 2.0 backend.

Authorization workflow

Prerequisites

  1. There should be application client registered on UAA server.
  2. Client id and secret should be set in plugin env as username and password
  3. Client authorities should include uaa.resource
  4. RabbitMQ auth_backends should include rabbit_auth_backend_uaa

Authorization

  1. Client authorize with UAA, requesting access_token (using any grant type)
  2. Token scope should contain rabbitmq resource scopes (e.g. /_q_configure_foo - configure queue 'foo')
  3. Client use token as username to connect to RabbitMQ server