From: Dylan William Hardison Date: Fri, 30 Nov 2018 19:46:29 +0000 (-0500) Subject: no bug - document how to use with auth0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=404a4674ab23682595944629b7e458d9ed3ed468;p=thirdparty%2Fbugzilla.git no bug - document how to use with auth0 --- diff --git a/docs/en/rst/integrating/auth0.rst b/docs/en/rst/integrating/auth0.rst new file mode 100644 index 000000000..461759ebb --- /dev/null +++ b/docs/en/rst/integrating/auth0.rst @@ -0,0 +1,42 @@ +.. _auth0: + +Adding an Auth0 Custom Social Integration +######################################### + +Bugzilla can be added as a 'Custom Social Connection'. + +==================== ============================================ ====================================================== +Parameter Example(s) Notes +-------------------- -------------------------------------------- ------------------------------------------------------ +Name BMO-Stage Whatever makes you happy +Client ID aaaaaaaaaaaaaaaaaaaa Ask your Bugzilla admin to create one for you. +Client Secret aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Same as above. +Authorization URL https://bugzilla.allizom.org/oauth/authorize Note the http client must use the correct HOST header. +Token URL https://bugzilla.allizom.org/oauth/access_token (none) +Scope user:read As of this writing, this is the only scope available. +Fetch User Profile (see below) (none) + +.. code-block:: javascript + function (access_token, ctx, callback) { + request.get('https://bugzilla.allizom.org/api/user/profile', { + 'headers': { + 'Authorization': 'Bearer ' + access_token, + 'User-Agent': 'Auth0' + } + }, function (e, r, b) { + if (e) { + return callback(e); + } + if (r.statusCode !== 200) { + return callback(new Error(`StatusCode: ${r.statusCode}`)); + } + var profile = JSON.parse(b); + callback(null, { + user_id: profile.id, + nickname: profile.nick, + name: profile.name, + email: profile.login, + email_verified: true + }); + }); + } diff --git a/docs/en/rst/integrating/index.rst b/docs/en/rst/integrating/index.rst index 794bc0ad8..28e5e8011 100644 --- a/docs/en/rst/integrating/index.rst +++ b/docs/en/rst/integrating/index.rst @@ -21,3 +21,4 @@ explains how to use the available mechanisms for integration and customization. extensions apis auth-delegation + auth0