]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - document how to use with auth0
authorDylan William Hardison <dylan@hardison.net>
Fri, 30 Nov 2018 19:46:29 +0000 (14:46 -0500)
committerDylan William Hardison <dylan@hardison.net>
Fri, 30 Nov 2018 19:46:44 +0000 (14:46 -0500)
docs/en/rst/integrating/auth0.rst [new file with mode: 0644]
docs/en/rst/integrating/index.rst

diff --git a/docs/en/rst/integrating/auth0.rst b/docs/en/rst/integrating/auth0.rst
new file mode 100644 (file)
index 0000000..461759e
--- /dev/null
@@ -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
+      });
+    });
+  }
index 794bc0ad8250d18f95566e3e05278847a9df5f4c..28e5e80116eee907610671f24ee3cd40ea175951 100644 (file)
@@ -21,3 +21,4 @@ explains how to use the available mechanisms for integration and customization.
    extensions
    apis
    auth-delegation
+   auth0