From faf5a45a5983c0c5b44dc3bbd321593c1565e8a1 Mon Sep 17 00:00:00 2001 From: Luka Skukan Date: Thu, 15 Dec 2016 15:39:48 +0100 Subject: [PATCH 1/2] Document creating social directory --- lib/Client.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/Client.js b/lib/Client.js index b3c2bedb..f15644f1 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -682,6 +682,10 @@ Client.prototype.getDirectories = function() { * creating a directory, you will likely want to map it to an {@link Application} using * {@link Application#createAccountStoreMapping Application.createAccountStoreMapping()}. * + * Directories can be linked to social providers, such as Facebook, Google or Twitter, + * by specifing a valid provider containing the valid `providerId` and client credentials + * when creating or modifying the directory. See {@link Provider}. + * * @param {Object} directory * The {@link Directory} resource to create. * @@ -692,6 +696,7 @@ Client.prototype.getDirectories = function() { * Callback function, will be called with (err, {@link Directory}). * * @example + * // Creating a simple directory * var newDirectory = { * name: 'Customers' * } @@ -699,6 +704,20 @@ Client.prototype.getDirectories = function() { * client.createDirectory(newDirectory, function (err, directory) { * console.log(directory); * }); + * + * // Creating a social provider directory (e.g. Twitter) + * var twitterDirectory = { + * name: 'Twitter Users', + * provider: { + * providerId: 'twitter', + * clientId: 'my-twitter-client-id', + * clientSecret: 'my-twitter-client-secret' + * } + * }; + * + * client.createDirectory(twitterDirectory, function (err, directory) { + * console.log(directory); + * }); */ Client.prototype.createDirectory = function() { var args = utils.resolveArgs(arguments, ['dir', 'options', 'callback']); From 4ac007aa0958286adfc6ace1681e8459274a0d77 Mon Sep 17 00:00:00 2001 From: Luka Skukan Date: Thu, 15 Dec 2016 15:45:19 +0100 Subject: [PATCH 2/2] Add comment about generic OAuth2 providers --- lib/Client.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Client.js b/lib/Client.js index f15644f1..31fd1851 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -682,9 +682,10 @@ Client.prototype.getDirectories = function() { * creating a directory, you will likely want to map it to an {@link Application} using * {@link Application#createAccountStoreMapping Application.createAccountStoreMapping()}. * - * Directories can be linked to social providers, such as Facebook, Google or Twitter, - * by specifing a valid provider containing the valid `providerId` and client credentials - * when creating or modifying the directory. See {@link Provider}. + * Directories can be linked to social providers - such as Facebook, Google, Twitter, or + * even any other generic OAuth 2.0 provider - by specifing a valid provider containing + * the valid `providerId` and client credentials when creating or modifying the directory. + * See {@link Provider}. * * @param {Object} directory * The {@link Directory} resource to create.