Skip to content

Commit

Permalink
Version 2.0.0-rc2-v1-22.4.02.00 release
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 30, 2024
1 parent 59ec526 commit 4f0a5bb
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 235 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# DocuSign Click C# Client Changelog
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.

## [v2.0.0-rc2] - Click API v1-22.4.02.00 - 2024-04-29
### Breaking Changes
- Updated from System.IdentityModel.Tokens.Jwt to Microsoft.IdentityModel.JsonWebTokens for token handling.
## [v2.0.0-rc1] - Click API v1-22.4.02.00 - 2024-04-05
### Breaking Changes
- Updated C# SDK dependencies.
Expand Down
104 changes: 42 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,78 @@
# The Official DocuSign Click C# Client
# The Official Docusign Click C# Client SDK

[![Nuget version][nuget-image]][nuget-url]
[![Nuget downloads][downloads-image]][downloads-url]

## Requirements

- Microsoft .NET version 4.5.2+ (4.7 recommended)
- Free [Developer Account](https://go.docusign.com/sandbox/productshot/?elqCampaignId=16531)

## Compatibility
Elastic signing (also known as Docusign Click) lets you capture consent to standard agreement terms with a single click: terms and conditions, terms of service, terms of use, privacy policies, and more. The Click API lets you include this customizable elastic template solution in your Docusign integrations.

- .NET Standard 2.0. See [.NET Standard Selector](https://immo.landwerth.net/netstandard-versions/) for details on versioning for the individual components in .NET Standard
- .NET Core 2.0
- Microsoft .NET version 4.5.2+ We no longer support [version 4.5.1](https://devblogs.microsoft.com/dotnet/support-ending-for-the-net-framework-4-4-5-and-4-5-1/)
- TLS 1.2
## Version Information
- **API version**: v1
- **Latest SDK version (Including prerelease)**: 2.0.0-rc2

## Note
## Requirements
* Microsoft .NET version 4.6.2+ (4.7 recommended)
* Free [developer account](https://go.docusign.com/o/sandbox/?postActivateUrl=https://developers.docusign.com/)

This open-source SDK is provided for cases where you would like to make additional changes that the SDK does not provide out-of-the-box. If you simply want to use the SDK with any of the examples shown in the [Developer Center](https://developers.docusign.com/esign-rest-api/code-examples), follow the installation instructions below.
## Compatibility
* .NET Standard 2.0. See [.NET Standard Selector](https://immo.landwerth.net/netstandard-versions/) for details on versioning for the individual components in .NET Standard.
* .NET Core 2.0 or above.
* Microsoft .NET version 4.6.2+.
* TLS 1.2

## Installation
This SDK is provided as open source, which enables you to customize its functionality to suit your particular use case. To do so, download or clone the repository. If the SDK’s given functionality meets your integration needs, or if you’re working through our [code examples](https://developers.docusign.com/docs/click-api/how-to/) from the [Docusign Developer Center](https://developers.docusign.com/), you merely need to install it by following the instructions below.

### NuGet Package Manager:

1. Create a new C# project, or open an existing one.
2. Click **Tools** -> **NuGet Package Manager** -> **Manage NuGet Packages for Solution**.
2. Select **Tools** -> **NuGet Package Manager** -> **Manage NuGet Packages for Solution.**
3. Search for **DocuSign**.
4. Select **DocuSign.Click**.
5. Click the check box next to your project name.
6. Click **Install**.
5. Select the check box next to your project name.
6. Click **Install.**

### Package Manager Console:

1. Open or create a new C# project.
2. Open the **Package Manager Console** by either:
1. Clicking **Package Manager Console** along the bottom of Visual Studio
2. Clicking **Tools** -> **NuGet Package Manager** -> **Package Manager Console**
1. Create a new C# project, or open an existing one.
2. Open the **Package Manager Console** by either method:
1. Clicking **Package Manager Console** along the bottom of Visual Studio
2. Clicking **Tools** -> **NuGet Package Manager** -> **Package Manager Console**
3. In the **Package Manager Console**, type: **Install-Package DocuSign.Click**

## Dependencies

This client has the following external dependencies:

### .NET Standard v2 and .NET Core:
* Newtonsoft.Json v13.0.3
* BouncyCastle.Cryptography v2.3.0
* System.ComponentModel.Annotations v5.0.0
* Microsoft.IdentityModel.JsonWebTokens v7.5.1

- Microsoft.CSharp v4.5.0
- Microsoft.IdentityModel.Protocols v5.4.0
- Newtonsoft.Json 11.0.2
- Portable.BouncyCastle v1.8.2
- RestSharp v106.3.1
- System.ComponentModel.Annotations v4.5.0
- System.IdentityModel.tokens.Jwt v5.4.0

### .NET Framework, version 4.6.2:
* Newtonsoft.Json v13.0.3
* BouncyCastle.Cryptography v2.3.0
* System.ComponentModel.Annotations v5.0.0
* Microsoft.IdentityModel.JsonWebTokens v7.5.1

### .NET Framework, version 4.5.2:
## Code examples
Explore our GitHub repository for the [Launcher](https://github.com/docusign/code-examples-csharp/), a self-executing package housing code examples for the Click C# SDK. This package showcases several common use cases and their respective source files. Additionally, you can download a version preconfigured for your Docusign developer account from [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/). These examples support both the [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) and [JSON Web Token (JWT)](https://developers.docusign.com/platform/auth/jwt/) authentication workflows.

- BouncyCastle v1.8.1
- Microsoft.CSharp v4.5.0
- Microsoft.IdentityModel.Protocols v5.4.0
- Newtonsoft.Json 11.0.2
- RestSharp v106.3.1
- System.ComponentModel.Annotations v4.5.0
- System.IdentityModel.tokens.Jwt v5.4.0


## Code Examples

### Launchers

DocuSign provides a sample application code referred to as a [Launcher](https://github.com/docusign/code-examples-csharp). The Launcher contains a set of 6 common use cases and associated source files. These examples use either DocuSign's [Authorization Code Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-code-grant) or [JSON Web Tokens (JWT)](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-jsonwebtoken) flows.

## OAuth Implementations

For details regarding which type of OAuth grant will work best for your DocuSign integration, see the [REST API Authentication Overview](https://developers.docusign.com/esign-rest-api/guides/authentication) guide located on the [DocuSign Developer Center](https://developers.docusign.com/).

For security purposes, DocuSign recommends using the [Authorization Code Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-code-grant) flow.
## OAuth implementations
For details regarding which type of OAuth grant will work best for your Docusign integration, see [Choose OAuth Type](https://developers.docusign.com/platform/auth/choose/) in the [Docusign Developer Center](https://developers.docusign.com/).

For security purposes, Docusign recommends using the [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) flow.

## Support

Log issues against this client through GitHub. We also have an [active developer community on Stack Overflow](https://stackoverflow.com/questions/tagged/docusignapi).

## License
The Docusign Click C# Client SDK is licensed under the [MIT License](https://github.com/docusign/docusign-esign-csharp-client/blob/master/LICENSE).

The DocuSign Rooms C# Client is licensed under the [MIT License](https://github.com/docusign/docusign-click-csharp-client/blob/master/LICENSE).

## Additional resources
* [Docusign Developer Center](https://developers.docusign.com/)
* [Docusign API on Twitter](https://twitter.com/docusignapi)
* [Docusign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/)
* [Docusign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ)

[nuget-image]: https://img.shields.io/nuget/v/DocuSign.Click.svg?style=flat
[nuget-url]: https://www.nuget.org/packages/DocuSign.Click
[downloads-image]: https://img.shields.io/nuget/dt/DocuSign.Click
[downloads-image]: https://img.shields.io/nuget/dt/DocuSign.Click.svg?style=flat
[downloads-url]: https://www.nuget.org/packages/DocuSign.Click

### Additional Resources
* [DocuSign Developer Center](https://developers.docusign.com)
* [DocuSign API on Twitter](https://twitter.com/docusignapi)
* [DocuSign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/)
* [DocuSign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ)
10 changes: 5 additions & 5 deletions sdk/DocuSign.Click.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocuSign.Click", "src\DocuSign.Click\DocuSign.Click.csproj", "{842DCB39-5959-472B-89A7-2EA888BFF2E3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocuSign.Click", "src\DocuSign.Click\DocuSign.Click.csproj", "{750FEB7C-6BC0-4DB4-81A2-16042A94F670}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{842DCB39-5959-472B-89A7-2EA888BFF2E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{842DCB39-5959-472B-89A7-2EA888BFF2E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{842DCB39-5959-472B-89A7-2EA888BFF2E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{842DCB39-5959-472B-89A7-2EA888BFF2E3}.Release|Any CPU.Build.0 = Release|Any CPU
{750FEB7C-6BC0-4DB4-81A2-16042A94F670}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{750FEB7C-6BC0-4DB4-81A2-16042A94F670}.Debug|Any CPU.Build.0 = Debug|Any CPU
{750FEB7C-6BC0-4DB4-81A2-16042A94F670}.Release|Any CPU.ActiveCfg = Release|Any CPU
{750FEB7C-6BC0-4DB4-81A2-16042A94F670}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
109 changes: 0 additions & 109 deletions sdk/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/src/DocuSign.Click/Client/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Configuration
/// Version of the package.
/// </summary>
/// <value>Version of the package.</value>
public const string Version = "2.0.0-rc1";
public const string Version = "2.0.0-rc2";

/// <summary>
/// Identifier for ISO 8601 DateTime Format
Expand Down
28 changes: 15 additions & 13 deletions sdk/src/DocuSign.Click/Client/DocuSignClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

using DocuSign.Click.Client.Auth;
using Microsoft.IdentityModel.JsonWebTokens;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using Org.BouncyCastle.Crypto;
Expand All @@ -18,7 +19,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.IO;
using System.Linq;
using System.Net;
Expand Down Expand Up @@ -915,7 +915,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
{
string privateKey = Encoding.UTF8.GetString(privateKeyBytes);

JwtSecurityTokenHandler handler = new JwtSecurityTokenHandler
JsonWebTokenHandler handler = new JsonWebTokenHandler
{
SetDefaultTimesOnTokenCreation = false
};
Expand Down Expand Up @@ -953,12 +953,13 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
throw new ApiException(400, "Private key not supplied or is invalid!");
}

var token = handler.CreateToken(descriptor);
string jwtToken = handler.WriteToken(token);
var jwtToken = handler.CreateToken(descriptor);

var localVarFormParams = new Dictionary<String, String>();
localVarFormParams.Add("grant_type", OAuth.Grant_Type_JWT);
localVarFormParams.Add("assertion", jwtToken);
var localVarFormParams = new Dictionary<string, string>
{
{ "grant_type", OAuth.Grant_Type_JWT },
{ "assertion", jwtToken }
};

DocuSignRequest request = PrepareOAuthRequest(oauthBasePath, $"oauth/token", HttpMethod.Post, Configuration.DefaultHeader?.ToList(), localVarFormParams.ToList());
DocuSignResponse response = RestClient.SendRequest(request);
Expand Down Expand Up @@ -1003,7 +1004,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
{
string privateKey = Encoding.UTF8.GetString(privateKeyBytes);

JwtSecurityTokenHandler handler = new JwtSecurityTokenHandler();
JsonWebTokenHandler handler = new JsonWebTokenHandler();

SecurityTokenDescriptor descriptor = new SecurityTokenDescriptor()
{
Expand All @@ -1028,12 +1029,13 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
throw new ApiException(400, "Private key not supplied or is invalid!");
}

var token = handler.CreateToken(descriptor);
string jwtToken = handler.WriteToken(token);
var jwtToken = handler.CreateToken(descriptor);

var localVarFormParams = new Dictionary<String, String>();
localVarFormParams.Add("grant_type", OAuth.Grant_Type_JWT);
localVarFormParams.Add("assertion", jwtToken);
var localVarFormParams = new Dictionary<string, string>
{
{ "grant_type", OAuth.Grant_Type_JWT },
{ "assertion", jwtToken }
};

DocuSignRequest request = PrepareOAuthRequest(oauthBasePath, $"oauth/token", HttpMethod.Post, Configuration.DefaultHeader?.ToList(), localVarFormParams.ToList());
DocuSignResponse response = RestClient.SendRequest(request);
Expand Down
Loading

0 comments on commit 4f0a5bb

Please sign in to comment.