{"body": "
\n

# Authentication\u00b6

\n

Protecting your Flower instance from unwarranted access is important\nif it runs in an untrusted environment. Below, we outline the various\nforms of authentication supported by Flower.

\n
\n

## HTTP Basic Authentication\u00b6

\n

Securing Flower with Basic Authentication is easy.

\n

The –basic_auth option accepts user:password pairs separated by\na comma. If configured, any client trying to access this\nFlower instance will be prompted to provide the credentials specified in\nthis argument:

\n

    $ celery flower --basic_auth=user1:password1,user2:password2\n

\n
\n

See also Running behind reverse proxy

\n
\n
\n

## Google OAuth 2.0\u00b6

\n

Flower supports Google OAuth 2.0. This way you can authenticate any user\nwith a Google account. Google OAuth 2.0 authentication is enabled using the\n–auth, –oauth2_key, –oauth2_secret and –oauth2_redirect_uri options.

\n

–auth is a regular expression, for granting access only to the specified email pattern.\n–oauth2_key and –oauth2_secret are your credentials from your Google Developer Console.\n–oauth2_redirect_uri is there to specify what is the redirect_uri associated to you key and secret

\n

For instance, if you want to grant access to me@gmail.com and you@gmail.com:

\n

    $ celery flower --auth="me@gmail.com|you@gmail.com" --oauth2_key=... --oauth2_secret=... --oauth2_redirect_uri=http://flower.example.com/login\n

\n
\n

Alternatively you can set environment variables instead of command line arguments:

\n

    $ export FLOWER_OAUTH2_KEY=...\n$ export FLOWER_OAUTH2_SECRET=...\n$ export FLOWER_OAUTH2_REDIRECT_URI=http://flower.example.com/login\n$ celery flower --auth=.*@example\\.com\n

\n
\n

\n
NOTE: Enable Google Plus API in the Google Developers Console under APIs & auth -> APIs -> Google+ API
\n
  Otherwise you will get a 403 Forbidden error despite correct OAuth configuration.
\n

\n
\n
\n

## GitHub OAuth\u00b6

\n

Flower also supports GitHub OAuth. Flower should be registered in\n<https://github.com/settings/applications/new> before getting started.\nSee GitHub OAuth API docs for more info.

\n

GitHub OAuth should be activated using –auth_provider option.\nThe client id, secret and redirect uri should be provided using\n–oauth2_key, –oauth2_secret and –oauth2_redirect_uri options or using\nFLOWER_OAUTH2_KEY, FLOWER_OAUTH2_SECRET and FLOWER_OAUTH2_REDIRECT_URI\nenvironment variables.:

\n

    $ export FLOWER_OAUTH2_KEY=7956724aafbf5e1a93ac\n$ export FLOWER_OAUTH2_SECRET=f9155f764b7e466c445931a6e3cc7a42c4ce47be\n$ export FLOWER_OAUTH2_REDIRECT_URI=http://localhost:5555/login\n$ celery flower --auth_provider=flower.views.auth.GithubLoginHandler --auth=.*@example\\.com\n

\n
\n
\n
\n", "alabaster_version": "0.7.7", "display_toc": true, "title": "Authentication", "sourcename": "auth.txt", "customsidebar": null, "metatags": "", "current_page_name": "auth", "next": {"link": "../reverse-proxy/", "title": "Running behind reverse proxy"}, "rellinks": [["reverse-proxy", "Running behind reverse proxy", "N", "next"], ["api", "API Reference", "P", "previous"]], "meta": {}, "parents": [], "sidebars": ["sidebarlogo.html", "localtoc.html", "relations.html", "sourcelink.html", "searchbox.html"], "toc": "

\n
- Authentication
  \n
  - HTTP Basic Authentication
  \n
  - Google OAuth 2.0
  \n
  - GitHub OAuth
  \n
  \n
\n

\n", "prev": {"link": "../api/", "title": "API Reference"}, "page_source_suffix": ".rst"}