From fdfcd1b7190ed7c06be5785076cffc12c09e3c48 Mon Sep 17 00:00:00 2001 From: Chris Pluta Date: Fri, 31 Jan 2020 00:07:35 -0600 Subject: [PATCH] Reording auth section code samples --- docs/authorization/generating_token.rst | 36 +++++++++---------- docs/authorization/refreshing_token.rst | 47 +++++++++++++------------ docs/index.rst | 8 ++--- 3 files changed, 46 insertions(+), 45 deletions(-) diff --git a/docs/authorization/generating_token.rst b/docs/authorization/generating_token.rst index 7e9ec8b..65cf46e 100644 --- a/docs/authorization/generating_token.rst +++ b/docs/authorization/generating_token.rst @@ -13,13 +13,22 @@ Generating Token Create a short lived access token to be used for authorized API calls. Typically a token will last 3600 seconds(one hour). .. tabs:: + + .. group-tab:: REST - .. group-tab:: C# - - .. code-block:: c# + .. code-block:: http + + POST https://auth.meshydb.com/{accountName}/connect/token HTTP/1.1 + Content-Type: application/x-www-form-urlencoded - var client = MeshyClient.Initialize(accountName, publicKey); - var connection = client.LoginWithPassword(username, password); + client_id={publicKey}& + grant_type=password& + username={username}& + password={password}& + scope=meshy.api offline_access + + + (Form-encoding removed, and line breaks added for readability) |parameters| @@ -51,21 +60,12 @@ Create a short lived access token to be used for authorized API calls. Typically password : :type:`string`, :required:`required` User secret credentials for login. When anonymous it is static as nopassword. - .. group-tab:: REST + .. group-tab:: C# - .. code-block:: http - - POST https://auth.meshydb.com/{accountName}/connect/token HTTP/1.1 - Content-Type: application/x-www-form-urlencoded - - client_id={publicKey}& - grant_type=password& - username={username}& - password={password}& - scope=meshy.api offline_access + .. code-block:: c# - - (Form-encoding removed, and line breaks added for readability) + var client = MeshyClient.Initialize(accountName, publicKey); + var connection = client.LoginWithPassword(username, password); |parameters| diff --git a/docs/authorization/refreshing_token.rst b/docs/authorization/refreshing_token.rst index cb737c0..b37ad1c 100644 --- a/docs/authorization/refreshing_token.rst +++ b/docs/authorization/refreshing_token.rst @@ -16,15 +16,19 @@ Once the token expires the refresh token can be used to generate a new set of cr .. tabs:: - .. group-tab:: C# + .. group-tab:: REST - .. code-block:: c# + .. code-block:: http + + POST https://auth.meshydb.com/{accountName}/connect/token HTTP/1.1 + Content-Type: application/x-www-form-urlencoded + + client_id={publicKey}& + grant_type=refresh_token& + refresh_token={refresh_token} - var client = MeshyClient.Initialize(accountName, publicKey); - var connection = client.LoginWithPassword(username, password); - var refreshToken = connection.RetrieveRefreshToken(); - connection = await client.LoginWithRefreshAsync(refreshToken); + (Form-encoding removed, and line breaks added for readability) |parameters| @@ -32,13 +36,9 @@ Once the token expires the refresh token can be used to generate a new set of cr Indicates which account you are connecting to. publicKey : :type:`string`, :required:`required` Public identifier of connecting service. - username : :type:`string`, :required:`required` - Unique user name for authentication. - password : :type:`string`, :required:`required` - User secret credentials for login. When anonymous it is static as nopassword. - refreshToken : :type:`string`, :required:`required` + refresh_token : :type:`string`, :required:`required` Refresh token generated from previous access token generation. - + .. group-tab:: NodeJS .. code-block:: javascript @@ -64,19 +64,16 @@ Once the token expires the refresh token can be used to generate a new set of cr refreshToken : :type:`string`, :required:`required` Refresh token generated from previous access token generation. - .. group-tab:: REST + + .. group-tab:: C# - .. code-block:: http - - POST https://auth.meshydb.com/{accountName}/connect/token HTTP/1.1 - Content-Type: application/x-www-form-urlencoded - - client_id={publicKey}& - grant_type=refresh_token& - refresh_token={refresh_token} + .. code-block:: c# + var client = MeshyClient.Initialize(accountName, publicKey); + var connection = client.LoginWithPassword(username, password); + var refreshToken = connection.RetrieveRefreshToken(); - (Form-encoding removed, and line breaks added for readability) + connection = await client.LoginWithRefreshAsync(refreshToken); |parameters| @@ -84,7 +81,11 @@ Once the token expires the refresh token can be used to generate a new set of cr Indicates which account you are connecting to. publicKey : :type:`string`, :required:`required` Public identifier of connecting service. - refresh_token : :type:`string`, :required:`required` + username : :type:`string`, :required:`required` + Unique user name for authentication. + password : :type:`string`, :required:`required` + User secret credentials for login. When anonymous it is static as nopassword. + refreshToken : :type:`string`, :required:`required` Refresh token generated from previous access token generation. .. rubric:: Responses diff --git a/docs/index.rst b/docs/index.rst index 0ceaec4..25caeef 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,18 +31,18 @@ Next Steps Now that you have your public key, you can begin with any of our language specific quick starts: - * `C# `_ - * `NodeJS `_ * `REST `_ + * `NodeJS `_ + * `C# `_ .. toctree:: :maxdepth: 1 :hidden: :caption: Getting Started - intro/getting_started_csharp - intro/getting_started_nodejs intro/getting_started_rest + intro/getting_started_nodejs + intro/getting_started_csharp .. toctree:: :maxdepth: 2