Skip to content

Commit 261e120

Browse files
authored
Merge pull request #5 from AaronWDS/DEVDOCS-1178
DEVDOCS-1178
2 parents e425de1 + dec71e8 commit 261e120

File tree

9 files changed

+116
-146
lines changed

9 files changed

+116
-146
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ The **refresh token** is not used in this example.
6666
Coming soon...
6767
1. **Requiring an Access Code for a Recipient**
6868
[Source.](./eg-03-csharp-auth-code-grant-core/Controllers/Eg019AccessCodeAuthController.cs)
69-
This example sends and envelope that requires an access-code for the purpose of multi-factor authentication.
69+
This example sends an envelope that requires an access-code for the purpose of multi-factor authentication.
7070
1. **Requiring SMS authentication for a recipient**
7171
[Source.](./eg-03-csharp-auth-code-grant-core/Controllers/Eg020SmsAuthController.cs)
72-
This example sends and envelope that requires entering in a six digit code from an text message for the purpose of multi-factor authentication.
72+
This example sends an envelope that requires entering in a six digit code from an text message for the purpose of multi-factor authentication.
7373
1. **Requiring Phone authentication for a recipient**
7474
[Source.](./eg-03-csharp-auth-code-grant-core/Controllers/Eg021PhoneAuthController.cs)
75-
This example sends and envelope that requires entering in a voice-based response code for the purpose of multi-factor authentication.
75+
This example sends an envelope that requires entering in a voice-based response code for the purpose of multi-factor authentication.
7676
1. **Requiring Knowledge-Based Authentication (KBA) for a Recipient**
7777
[Source.](./eg-03-csharp-auth-code-grant-core/Controllers/Eg022KbaAuthController.cs)
78-
This example sends and envelope that requires passing a Public records check to validate identity for the purpose of multi-factor authentication.
78+
This example sends an envelope that requires passing a Public records check to validate identity for the purpose of multi-factor authentication.
7979
1. **Requiring ID Verification (IDV) for a recipient**
8080
[Source.](./eg-03-csharp-auth-code-grant-core/Controllers/Eg023IdvAuthController.cs)
81-
This example sends and envelope that requires submitting a photo of a government issued id for the purpose of multi-factor authentication.
81+
This example sends an envelope that requires submitting a photo of a government issued id for the purpose of multi-factor authentication.
8282

8383

8484

eg-03-csharp-auth-code-grant-core/Controllers/Eg019AccessCodeAuthController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public Eg019AccessCodeAuthController(DSConfiguration config, IRequestItemsServic
2222

2323

2424
[HttpPost]
25-
public IActionResult Create(string signerEmail, string signerName)
25+
public IActionResult Create(string signerEmail, string signerName, string accessCode)
2626
{
2727
// Check the token with minimal buffer time.
2828
bool tokenOk = CheckToken(3);
@@ -97,7 +97,7 @@ public IActionResult Create(string signerEmail, string signerName)
9797
Status = "Created",
9898
DeliveryMethod = "Email",
9999
RecipientId = recipientId,
100-
AccessCode = signerName,
100+
AccessCode = accessCode,
101101
Tabs = signer1Tabs
102102
};
103103

eg-03-csharp-auth-code-grant-core/Controllers/Eg020SmsAuthController.cs

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,16 @@ namespace eg_03_csharp_auth_code_grant_core.Controllers
1212
[Route("eg020")]
1313
public class Eg020SmsAuthController : EgController
1414
{
15-
public Eg020SmsAuthController(DSConfiguration config, IRequestItemsService requestItemsService)
15+
public Eg020SmsAuthController(DSConfiguration config, IRequestItemsService requestItemsService)
1616
: base(config, requestItemsService)
1717
{
1818
ViewBag.title = "SMS Authorization";
1919
}
2020

2121
public override string EgName => "eg020";
2222

23-
24-
// Data for this method:
25-
// signerEmail
26-
// signerName
27-
// phoneNumber
2823
[HttpPost]
29-
public IActionResult Create(string signerEmail, string signerName, string signerPhone )
24+
public IActionResult Create(string signerEmail, string signerName, string phoneNumber)
3025
{
3126
// Check the token with minimal buffer time.
3227
bool tokenOk = CheckToken(3);
@@ -38,15 +33,16 @@ public IActionResult Create(string signerEmail, string signerName, string signer
3833
RequestItemsService.EgName = EgName;
3934
return Redirect("/ds/mustAuthenticate");
4035
}
41-
4236

43-
var basePath = RequestItemsService.Session.BasePath + "/restapi";
44-
var recipientId = Guid.NewGuid().ToString();
37+
// Data for this method:
38+
// signerEmail
39+
// signerName
4540

41+
var basePath = RequestItemsService.Session.BasePath + "/restapi";
4642

4743
// Step 1: Obtain your OAuth token
48-
var accessToken = RequestItemsService.User.AccessToken;
49-
var accountId = RequestItemsService.Session.AccountId;
44+
var accessToken = RequestItemsService.User.AccessToken; //represents your {ACCESS_TOKEN}
45+
var accountId = RequestItemsService.Session.AccountId; //represents your {ACCOUNT_ID}
5046

5147
// Step 2: Construct your API headers
5248
var config = new Configuration(new ApiClient(basePath));
@@ -82,8 +78,7 @@ public IActionResult Create(string signerEmail, string signerName, string signer
8278
DocumentId = "1",
8379
// A 1- to 8-digit integer or 32-character GUID to match recipient IDs on your own systems.
8480
// This value is referenced in the Tabs element below to assign tabs on a per-recipient basis.
85-
86-
RecipientId = recipientId
81+
RecipientId = "1" //represents your {RECIPIENT_ID}
8782
};
8883

8984
// Tabs are set per recipient/signer
@@ -94,22 +89,17 @@ public IActionResult Create(string signerEmail, string signerName, string signer
9489

9590
RecipientSMSAuthentication smsAuth = new RecipientSMSAuthentication();
9691
smsAuth.SenderProvidedNumbers = new List<String>();
97-
string[] phNumbers = signerPhone.Split(",");
98-
foreach (var phNumber in phNumbers)
99-
{
100-
smsAuth.SenderProvidedNumbers.Add(phNumber);
101-
102-
}
103-
10492

93+
// You may call the SenderProvidedNumbers.Add method repeatedly for multiple phone numbers.
94+
smsAuth.SenderProvidedNumbers.Add(phoneNumber); // represents your {PHONE_NUMBER}.
10595
Signer signer1 = new Signer()
10696
{
10797
Name = signerName,
10898
Email = signerEmail,
10999
RoutingOrder = "1",
110100
Status = "Created",
111101
DeliveryMethod = "Email",
112-
RecipientId = recipientId,
102+
RecipientId = "1", //represents your {RECIPIENT_ID},
113103
IdCheckConfigurationName = "SMS Auth $",
114104
RequireIdLookup = "true",
115105
Tabs = signer1Tabs,
@@ -124,7 +114,7 @@ public IActionResult Create(string signerEmail, string signerName, string signer
124114
// Step 4: Call the eSignature REST API
125115
EnvelopesApi envelopesApi = new EnvelopesApi(config);
126116
EnvelopeSummary results = envelopesApi.CreateEnvelope(accountId, env);
127-
117+
128118
ViewBag.h1 = "Envelope sent";
129119
ViewBag.message = "The envelope has been created and sent!<br />Envelope ID " + results.EnvelopeId + ".";
130120
return View("example_done");

eg-03-csharp-auth-code-grant-core/Controllers/Eg021PhoneAuthController.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace eg_03_csharp_auth_code_grant_core.Controllers
1212
[Route("eg021")]
1313
public class Eg021PhoneAuthController : EgController
1414
{
15-
public Eg021PhoneAuthController(DSConfiguration config, IRequestItemsService requestItemsService)
15+
public Eg021PhoneAuthController(DSConfiguration config, IRequestItemsService requestItemsService)
1616
: base(config, requestItemsService)
1717
{
1818
ViewBag.title = "Phone Authenticatication";
@@ -22,7 +22,7 @@ public Eg021PhoneAuthController(DSConfiguration config, IRequestItemsService req
2222

2323

2424
[HttpPost]
25-
public IActionResult Create(string signerEmail, string signerName, string signerPhone)
25+
public IActionResult Create(string signerEmail, string signerName, string phoneNumber)
2626
{
2727
// Check the token with minimal buffer time.
2828
bool tokenOk = CheckToken(3);
@@ -37,14 +37,12 @@ public IActionResult Create(string signerEmail, string signerName, string signer
3737

3838
// Data for this method:
3939
// signerEmail
40-
// signerName
40+
// signerName
4141
var basePath = RequestItemsService.Session.BasePath + "/restapi";
42-
var recipientId = Guid.NewGuid().ToString();
43-
4442

4543
// Step 1: Obtain your OAuth token
46-
var accessToken = RequestItemsService.User.AccessToken;
47-
var accountId = RequestItemsService.Session.AccountId;
44+
var accessToken = RequestItemsService.User.AccessToken; //represents your {ACCESS_TOKEN}
45+
var accountId = RequestItemsService.Session.AccountId; //represents your {ACCOUNT_ID}
4846

4947
// Step 2: Construct your API headers
5048
var config = new Configuration(new ApiClient(basePath));
@@ -80,7 +78,7 @@ public IActionResult Create(string signerEmail, string signerName, string signer
8078
DocumentId = "1",
8179
// A 1- to 8-digit integer or 32-character GUID to match recipient IDs on your own systems.
8280
// This value is referenced in the Tabs element below to assign tabs on a per-recipient basis.
83-
RecipientId = recipientId
81+
RecipientId = "1" //represents your {RECIPIENT_ID}
8482
};
8583

8684
// Tabs are set per recipient/signer
@@ -90,13 +88,9 @@ public IActionResult Create(string signerEmail, string signerName, string signer
9088
};
9189
RecipientPhoneAuthentication phoneAuthNumber = new RecipientPhoneAuthentication();
9290
phoneAuthNumber.SenderProvidedNumbers = new List<String>();
93-
string[] phNumbers = signerPhone.Split(",");
94-
foreach (var phNumber in phNumbers)
95-
{
96-
phoneAuthNumber.SenderProvidedNumbers.Add(phNumber);
97-
98-
}
9991

92+
// You may call the SenderProvidedNumbers.Add method repeatedly for multiple phone numbers.
93+
phoneAuthNumber.SenderProvidedNumbers.Add(phoneNumber); // represents your {PHONE_NUMBER}.
10094
RecipientPhoneAuthentication phoneAuth = new RecipientPhoneAuthentication()
10195
{
10296
RecordVoicePrint = "false",
@@ -112,7 +106,7 @@ public IActionResult Create(string signerEmail, string signerName, string signer
112106
RoutingOrder = "1",
113107
Status = "Created",
114108
DeliveryMethod = "Email",
115-
RecipientId = recipientId,
109+
RecipientId = "1", //represents your {RECIPIENT_ID},
116110
RequireIdLookup = "true",
117111
Tabs = signer1Tabs,
118112
PhoneAuthentication = phoneAuth,
@@ -126,7 +120,7 @@ public IActionResult Create(string signerEmail, string signerName, string signer
126120
// Step 4: Call the eSignature REST API
127121
EnvelopesApi envelopesApi = new EnvelopesApi(config);
128122
EnvelopeSummary results = envelopesApi.CreateEnvelope(accountId, env);
129-
123+
130124
ViewBag.h1 = "Envelope sent";
131125
ViewBag.message = "The envelope has been created and sent!<br />Envelope ID " + results.EnvelopeId + ".";
132126
return View("example_done");

eg-03-csharp-auth-code-grant-core/Controllers/Eg022KbaAuthController.cs

Lines changed: 63 additions & 68 deletions
Large diffs are not rendered by default.

eg-03-csharp-auth-code-grant-core/Views/Eg019AccessCodeAuth/eg019.cshtml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@
2424
</p>
2525

2626
<form class="eg" action="" method="post" data-busy="form">
27-
<p>
28-
<strong>Note:</strong> The Access Code for example is the Signer Name.
29-
</p>
3027

28+
<div class="form-group">
29+
<label for="accessCode">Access Code</label>
30+
<input type="text" class="form-control" id="accessCode" name="accessCode"
31+
aria-describedby="acText" placeholder="Rnter a recipient access code here" required>
32+
<small id="acText" class="form-text text-muted">Provide this string to a recipient that is different such as in person or by mail or via different email.</small>
33+
</div>
3134
<div class="form-group">
3235
<label for="signerEmail">Signer Email</label>
3336
<input type="email" class="form-control" id="signerEmail" name="signerEmail"

eg-03-csharp-auth-code-grant-core/Views/Eg020SmsAuth/eg020.cshtml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@
2525

2626
<form class="eg" action="" method="post" data-busy="form">
2727

28-
<p>
29-
<strong>Note:</strong> To enter more than one Phone number, use a comma separated list. (eg: 415-555-1212, 650-555-1212)
30-
</p>
3128

3229
<div class="form-group">
3330
<label for="signerPhone">Signer Phone Number</label>
34-
<input type="tel" class="form-control" id="signerPhone" name="signerPhone"
31+
<input type="tel" class="form-control" id="phoneNumber" name="phoneNumber"
3532
aria-describedby="telHelp" placeholder="415-555-1212" required
3633
value="">
3734
<small id="telHelp" class="form-text text-muted">We'll never share your phone number with anyone else.</small>

eg-03-csharp-auth-code-grant-core/Views/Eg021PhoneAuth/eg021.cshtml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@
2525

2626
<form class="eg" action="" method="post" data-busy="form">
2727

28-
<p>
29-
<strong>Note:</strong> To enter more than one Phone number, use a comma separated list. (eg: 415-555-1212, 650-555-1212)
30-
</p>
31-
3228
<div class="form-group">
3329
<label for="signerPhone">Signer Phone Number</label>
34-
<input type="tel" class="form-control" id="signerPhone" name="signerPhone"
30+
<input type="tel" class="form-control" id="phoneNumber" name="phoneNumber"
3531
aria-describedby="telHelp" placeholder="415-555-1212" required
3632
value="">
3733
<small id="telHelp" class="form-text text-muted">We'll never share your phone number with anyone else.</small>

eg-03-csharp-auth-code-grant-core/Views/Home/Index.cshtml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -194,61 +194,56 @@
194194

195195
<h2>Recipient Authentication</h2>
196196
<h4 id="example019">19. <a href="eg019">Send an envelope with Access Code Recipient Authentication</a></h4>
197+
197198
<p>
198-
Anchor text
199-
(<a target='_blank' href="https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience">AutoPlace</a>)
200-
is used to position the signing fields in the documents.
199+
Submit an envelope with an access code for multi-factor authentication.
201200
</p>
202201
<p>
203202
API method used:
204203
<a target='_blank' href="https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create">Envelopes::create</a>.
205204
</p>
206205

207206
<h4 id="example020">20. <a href="eg020">Send an envelope with SMS Recipient Authentication</a></h4>
207+
208+
208209
<p>
209-
Anchor text
210-
(<a target='_blank' href="https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience">AutoPlace</a>)
211-
is used to position the signing fields in the documents.
210+
Submit an envelope with a text message for multi-factor authentication.
212211
</p>
213212
<p>
214213
API method used:
215214
<a target='_blank' href="https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create">Envelopes::create</a>.
216215
</p>
217216

218217
<h4 id="example021">21. <a href="eg021">Send an envelope with Phone Recipient Authentication</a></h4>
218+
219219
<p>
220-
Anchor text
221-
(<a target='_blank' href="https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience">AutoPlace</a>)
222-
is used to position the signing fields in the documents.
220+
Submit an envelope with a voice call to provide multi-factor authentication.
223221
</p>
224222
<p>
225223
API method used:
226224
<a target='_blank' href="https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create">Envelopes::create</a>.
227225
</p>
228226

229227
<h4 id="example022">22. <a href="eg022">Send an envelope with Recipient Knowledged Based Authentication</a></h4>
228+
230229
<p>
231-
Anchor text
232-
(<a target='_blank' href="https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience">AutoPlace</a>)
233-
is used to position the signing fields in the documents.
230+
Submit an envelope with multiple choice, public records based questions to provide multi-factor authentication.
234231
</p>
235232
<p>
236233
API method used:
237234
<a target='_blank' href="https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create">Envelopes::create</a>.
238235
</p>
239236

240-
<h4 id="example023">23. <a href="eg023">Send an envelope with Recipient Id Verification Authentication</a></h4>
237+
<h4 id="example023">23. <a href="eg023">Send an envelope with ID Verification Authentication</a></h4>
238+
241239
<p>
242-
Anchor text
243-
(<a target='_blank' href="https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience">AutoPlace</a>)
244-
is used to position the signing fields in the documents.
240+
Submit an envelope that requires verification of a government issued identity.
245241
</p>
246242
<p>
247243
API method used:
248244
<a target='_blank' href="https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create">Envelopes::create</a>.
249245
</p>
250-
</div>
251-
<!-- anchor-js is only for the index page -->
252-
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.1/anchor.min.js"></script>
253-
<script>anchors.options.placement = 'left'; anchors.add('h4')</script>
246+
<!-- anchor-js is only for the index page -->
247+
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.1/anchor.min.js"></script>
248+
<script>anchors.options.placement = 'left'; anchors.add('h4')</script>
254249

0 commit comments

Comments
 (0)