-
Notifications
You must be signed in to change notification settings - Fork 0
/
2021-06-17-hmac-credentials.html
669 lines (511 loc) · 52.1 KB
/
2021-06-17-hmac-credentials.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content="blogarchitectureconnectivity, ">
<title> Support for HMAC-SHA256 signing for connections • Eclipse Ditto™</title>
<link rel="stylesheet" href="css/syntax.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="css/modern-business.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="css/customstyles.css">
<link rel="stylesheet" href="css/boxshadowproperties.css">
<link rel="stylesheet" href="css/theme-ditto.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/2.1.0/anchor.min.js" crossorigin="anonymous"></script>
<script src="js/toc.js"></script>
<script src="js/customscripts.js"></script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "https://www.eclipse.dev/ditto/",
"logo": "https://www.eclipse.dev/ditto/images/ditto.svg"
}
</script>
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="images/favicon-96x96.png" sizes="96x96">
<link rel="alternate" type="application/rss+xml" title="Eclipse Ditto Blog" href="https://www.eclipse.dev/ditto/feed.xml">
<!-- Eclipse Foundation cookie consent: -->
<link rel="stylesheet" type="text/css" href="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/vendor/cookieconsent/cookieconsent.min.css" />
<script src="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/javascript/vendor/cookieconsent/default.min.js"></script>
<script>
$(document).ready(function() {
$("#tg-sb-link").click(function() {
$("#tg-sb-sidebar").toggle();
$("#tg-sb-content").toggleClass('col-md-9');
$("#tg-sb-content").toggleClass('col-md-12');
$("#tg-sb-icon").toggleClass('fa-toggle-on');
$("#tg-sb-icon").toggleClass('fa-toggle-off');
});
});
</script>
</head>
<script>
(function(w,d,s,l,i){
w[l]=w[l]||[];
w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});
var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),
dl=l!='dataLayer'?'&l='+l:'';
j.async=true;
j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;
f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5WLCZXC');
</script>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container topnavlinks">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-ditto-home" href="index.html"> <img src="images/ditto_allwhite_symbolonly.svg" class="ditto-navbar-symbol" alt="Home"> <img src="images/ditto_allwhite_textonly.svg" class="ditto-navbar-symbol-text" alt="Eclipse Ditto™"></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<!-- toggle sidebar button -->
<!--<li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li>-->
<!-- entries without drop-downs appear here -->
<li><a href="blog.html">Blog</a></li>
<li><a href="intro-overview.html">Documentation</a></li>
<li><a href="http-api-doc.html">HTTP API</a></li>
<li><a href="sandbox.html">Sandbox</a></li>
<li><a href="https://github.com/eclipse-ditto/ditto" target="_blank">
<img src="images/GitHub-Mark-Light-32px.png" alt="Sources at GitHub">
</a></li>
<li><a href="https://github.com/eclipse-ditto/ditto-clients" target="_blank">
<img src="images/GitHub-Mark-Light-32px.png" alt="SDK sources at GitHub">SDKs
</a></li>
<li><a href="https://github.com/eclipse-ditto/ditto-examples" target="_blank">
<img src="images/GitHub-Mark-Light-32px.png" alt="Example sources at GitHub">examples
</a></li>
<!-- entries with drop-downs appear here -->
<!-- conditional logic to control which topnav appears for the audience defined in the configuration file.-->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Links<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://projects.eclipse.org/projects/iot.ditto" target="_blank">Eclipse Ditto Project</a></li>
<li><a href="https://www.eclipse.org/forums/index.php/f/364/" target="_blank">Forum</a></li>
<li><a href="https://ci.eclipse.org/ditto/" target="_blank">Jenkins</a></li>
<li><a href="https://dev.eclipse.org/mhonarc/lists/ditto-dev/" target="_blank">Mailing list archives</a></li>
<li><a href="https://gitter.im/eclipse/ditto" target="_blank">Gitter.im chat</a></li>
</ul>
</li>
<!--comment out this block if you want to hide search-->
<li>
<!--start search-->
<div id="search-demo-container">
<input type="text" id="search-input" placeholder="search...">
<ul id="results-container"></ul>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/simple-jekyll-search/0.0.9/jekyll-search.js" type="text/javascript"></script>
<script type="text/javascript">
SimpleJekyllSearch.init({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
dataSource: 'search.json',
searchResultTemplate: '<li><a href="{url}" title="Support for HMAC-SHA256 signing for connections">{title}</a></li>',
noResultsText: 'No results found.',
limit: 10,
fuzzy: true,
})
</script>
<!--end search-->
</li>
</ul>
</div>
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div id="main">
<!-- Content Row -->
<div class="row">
<!-- Content Column -->
<div class="col-md-12" id="tg-sb-content">
<!-- Look the author details up from the site config. -->
<!-- Output author details if some exist. -->
<!-- Output author details if some exist. -->
<!---->
<!--<span>-->
<!--<!– Mugshot. –>-->
<!--<img src="https://www.gravatar.com/avatar/9ca96e4eae3d3cf7df52ece39dc0b2fb?s=135" alt="A photo of Florian Fendt" />-->
<!--<!– Personal Info. –>-->
<!--Written by <a href="https://github.com/ffendt" target="_blank">Florian Fendt</a>-->
<!--</span>-->
<!---->
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">Support for HMAC-SHA256 signing for connections</h1>
<p class="post-meta">Published by <img src="https://www.gravatar.com/avatar/9ca96e4eae3d3cf7df52ece39dc0b2fb?s=135" alt="A photo of Florian Fendt" style="width:50px;border-radius:50%;display:inline-block;margin-right:5px;" /><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name"><a href="https://github.com/ffendt" target="_blank">Florian Fendt</a> </span></span> on <time datetime="2021-06-17T00:00:00+00:00" itemprop="datePublished">Jun 17, 2021</time> - Tags:
<a href="tag_blog.html">blog</a>,
<a href="tag_architecture.html">architecture</a>,
<a href="tag_connectivity.html">connectivity</a>
</p>
</header>
<div class="post-content" itemprop="articleBody">
<!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. -->
<script>
$( document ).ready(function() {
// Handler for .ready() called.
$('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3,h4' });
/* this offset helps account for the space taken up by the floating toolbar. */
$('#toc').on('click', 'a', function() {
var target = $(this.getAttribute('href'))
, scroll_target = target.offset().top
$(window).scrollTop(scroll_target - 10);
return false
})
});
</script>
<div id="toc"></div>
<p>With the upcoming release of Eclipse Ditto <strong>version 2.1.0</strong> it will be possible to use HMAC-SHA256 signing for
connections. The currently implemented algorithms support you in authenticating requests against:</p>
<ul>
<li>Azure IoT Hub REST API</li>
<li>Azure IoT Hub AMQP 1.0</li>
<li>Azure HTTP Monitor Data Collector API</li>
<li>Azure Service Bus REST API</li>
<li>Amazon Simple Notification Service (Amazon SNS)</li>
<li>other AWS services supporting Signature Version 4 signing (see external AWS documentation on
<a href="https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html">Signing AWS API requests</a>)</li>
</ul>
<p>Detailed information can be found at <a href="connectivity-hmac-signing.html">Connectivity API > HMAC request signing</a>.</p>
<p>This blog post shows different configurations with the <code class="language-plaintext highlighter-rouge">az-sasl</code> algorithm, that allow you to sign requests
against Azure IoT Hub (HTTP Push and AMQP 1.0) as well as Azure Service Bus (HTTP Push).</p>
<h1 id="prerequisites">Prerequisites</h1>
<p>For the examples you’ll need a running instance of Eclipse Ditto (see <a href="installation-running.html">Running Ditto</a>).
Additionally, a simple Thing is required, to which messages can be sent to.
Create the Thing <code class="language-plaintext highlighter-rouge">ditto:thing</code> with a <code class="language-plaintext highlighter-rouge">PUT</code> request to <code class="language-plaintext highlighter-rouge"><ditto>/api/2/things/ditto:thing</code> and content</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"thingId"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ditto:thing"</span><span class="p">,</span><span class="w">
</span><span class="nl">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{},</span><span class="w">
</span><span class="nl">"features"</span><span class="p">:</span><span class="w"> </span><span class="p">{},</span><span class="w">
</span><span class="nl">"_policy"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"entries"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"DEFAULT"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"subjects"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"{{ request:subjectId }}"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"the creator"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"integration:ditto"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"the connections"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"resources"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"policy:/"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"grant"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="s2">"READ"</span><span class="p">,</span><span class="w">
</span><span class="s2">"WRITE"</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nl">"revoke"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"thing:/"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"grant"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="s2">"READ"</span><span class="p">,</span><span class="w">
</span><span class="s2">"WRITE"</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nl">"revoke"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"message:/"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"grant"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="s2">"READ"</span><span class="p">,</span><span class="w">
</span><span class="s2">"WRITE"</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nl">"revoke"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<h1 id="azure-iot-hub-rest-api">Azure IoT Hub REST API</h1>
<p>This example shows how to invoke a <a href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-direct-methods">direct method</a>
on a device using Eclipse Ditto and Azure IoT Hub.</p>
<p>For creating signed requests against the Azure IoT Hub REST API, you’ll need the following information from your
Azure IoT Hub instance:</p>
<ul>
<li>The hostname (e.g. <code class="language-plaintext highlighter-rouge">my-hub.azure-devices.net</code>).</li>
<li>The name of a (Azure IoT Hub) shared access policy, which has the <code class="language-plaintext highlighter-rouge">Service connect</code> permission. By default, there
should be a policy named <code class="language-plaintext highlighter-rouge">service</code> which provides this permission.</li>
<li>The primary or secondary key of above policy.</li>
<li>A device in Azure IoT Hub with the ID <code class="language-plaintext highlighter-rouge">ditto:thing</code> (for the example this needs to be the same ID as the Thing created in prerequisites).</li>
</ul>
<p>What follows is a sample connection JSON for a connection named <code class="language-plaintext highlighter-rouge">Azure IoT Hub HTTP</code>, using hostname <code class="language-plaintext highlighter-rouge">my-hub.azure-devices.net</code> and
shared access policy <code class="language-plaintext highlighter-rouge">service</code> with key <code class="language-plaintext highlighter-rouge">theKey</code>. You can set the correct values from your Azure IoT Hub subscription
in the fields <code class="language-plaintext highlighter-rouge">uri</code>, <code class="language-plaintext highlighter-rouge">credentials.parameters.sharedKeyName</code>, <code class="language-plaintext highlighter-rouge">credentials.parameters.sharedKey</code> and
<code class="language-plaintext highlighter-rouge">credentials.parameters.endpoint</code>.</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"60d193e3-2639-415b-af29-0e337741141d"</span><span class="p">,</span><span class="w">
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Azure IoT Hub HTTP"</span><span class="p">,</span><span class="w">
</span><span class="nl">"connectionType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http-push"</span><span class="p">,</span><span class="w">
</span><span class="nl">"connectionStatus"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
</span><span class="nl">"uri"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://my-hub.azure-devices.net:443"</span><span class="p">,</span><span class="w">
</span><span class="nl">"sources"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
</span><span class="nl">"targets"</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w">
</span><span class="nl">"address"</span><span class="p">:</span><span class="w"> </span><span class="s2">"POST:/twins/{{ thing:id }}/methods?api-version=2018-06-30"</span><span class="p">,</span><span class="w">
</span><span class="nl">"topics"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"_/_/things/live/messages"</span><span class="p">],</span><span class="w">
</span><span class="nl">"authorizationContext"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"integration:ditto"</span><span class="p">],</span><span class="w">
</span><span class="nl">"issuedAcknowledgementLabel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"live-response"</span><span class="p">,</span><span class="w">
</span><span class="nl">"headerMapping"</span><span class="p">:</span><span class="w"> </span><span class="p">{},</span><span class="w">
</span><span class="nl">"payloadMapping"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"javascript"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nl">"clientCount"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
</span><span class="nl">"failoverEnabled"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"validateCertificates"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"processorPoolSize"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
</span><span class="nl">"specificConfig"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"parallelism"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"mappingDefinitions"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"javascript"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"mappingEngine"</span><span class="p">:</span><span class="w"> </span><span class="s2">"JavaScript"</span><span class="p">,</span><span class="w">
</span><span class="nl">"options"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"incomingScript"</span><span class="p">:</span><span class="w"> </span><span class="s2">"function mapToDittoProtocolMsg(</span><span class="se">\n</span><span class="s2"> headers,</span><span class="se">\n</span><span class="s2"> textPayload,</span><span class="se">\n</span><span class="s2"> bytePayload,</span><span class="se">\n</span><span class="s2"> contentType</span><span class="se">\n</span><span class="s2">) {</span><span class="se">\n\n</span><span class="s2"> if (contentType === 'application/vnd.eclipse.ditto+json') {</span><span class="se">\n</span><span class="s2"> return JSON.parse(textPayload);</span><span class="se">\n</span><span class="s2"> } else if (contentType === 'application/octet-stream') {</span><span class="se">\n</span><span class="s2"> try {</span><span class="se">\n</span><span class="s2"> return JSON.parse(Ditto.arrayBufferToString(bytePayload));</span><span class="se">\n</span><span class="s2"> } catch (e) {</span><span class="se">\n</span><span class="s2"> return null;</span><span class="se">\n</span><span class="s2"> }</span><span class="se">\n</span><span class="s2"> }</span><span class="se">\n</span><span class="s2"> return null;</span><span class="se">\n</span><span class="s2">}</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span><span class="w">
</span><span class="nl">"outgoingScript"</span><span class="p">:</span><span class="w"> </span><span class="s2">"function mapFromDittoProtocolMsg(</span><span class="se">\n</span><span class="s2"> namespace,</span><span class="se">\n</span><span class="s2"> name,</span><span class="se">\n</span><span class="s2"> group,</span><span class="se">\n</span><span class="s2"> channel,</span><span class="se">\n</span><span class="s2"> criterion,</span><span class="se">\n</span><span class="s2"> action,</span><span class="se">\n</span><span class="s2"> path,</span><span class="se">\n</span><span class="s2"> dittoHeaders,</span><span class="se">\n</span><span class="s2"> value,</span><span class="se">\n</span><span class="s2"> status,</span><span class="se">\n</span><span class="s2"> extra</span><span class="se">\n</span><span class="s2">) {</span><span class="se">\n\n</span><span class="s2"> let headers = dittoHeaders;</span><span class="se">\n</span><span class="s2"> let payload = {</span><span class="se">\n</span><span class="s2"> </span><span class="se">\"</span><span class="s2">methodName</span><span class="se">\"</span><span class="s2">: action,</span><span class="se">\n</span><span class="s2"> </span><span class="se">\"</span><span class="s2">responseTimeoutInSeconds</span><span class="se">\"</span><span class="s2">: parseInt(dittoHeaders.timeout),</span><span class="se">\n</span><span class="s2"> </span><span class="se">\"</span><span class="s2">payload</span><span class="se">\"</span><span class="s2">: value</span><span class="se">\n</span><span class="s2"> };</span><span class="se">\n</span><span class="s2"> let textPayload = JSON.stringify(payload);</span><span class="se">\n</span><span class="s2"> let bytePayload = null;</span><span class="se">\n</span><span class="s2"> let contentType = 'application/json';</span><span class="se">\n\n</span><span class="s2"> return Ditto.buildExternalMsg(</span><span class="se">\n</span><span class="s2"> headers, // The external headers Object containing header values</span><span class="se">\n</span><span class="s2"> textPayload, // The external mapped String</span><span class="se">\n</span><span class="s2"> bytePayload, // The external mapped byte[]</span><span class="se">\n</span><span class="s2"> contentType // The returned Content-Type</span><span class="se">\n</span><span class="s2"> );</span><span class="se">\n</span><span class="s2">}</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span><span class="w">
</span><span class="nl">"loadBytebufferJS"</span><span class="p">:</span><span class="w"> </span><span class="s2">"false"</span><span class="p">,</span><span class="w">
</span><span class="nl">"loadLongJS"</span><span class="p">:</span><span class="w"> </span><span class="s2">"false"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"credentials"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hmac"</span><span class="p">,</span><span class="w">
</span><span class="nl">"algorithm"</span><span class="p">:</span><span class="w"> </span><span class="s2">"az-sasl"</span><span class="p">,</span><span class="w">
</span><span class="nl">"parameters"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"sharedKeyName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"service"</span><span class="p">,</span><span class="w">
</span><span class="nl">"sharedKey"</span><span class="p">:</span><span class="w"> </span><span class="s2">"theKey"</span><span class="p">,</span><span class="w">
</span><span class="nl">"endpoint"</span><span class="p">:</span><span class="w"> </span><span class="s2">"my-hub.azure-devices.net"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>This connection configuration sends live messages to the endpoint at
<code class="language-plaintext highlighter-rouge">https://my-hub.azure-devices.net:443/twins/{{ thing:id }}/methods?api-version=2018-06-30</code>
and signs each request with a <a href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-dev-guide-sas?tabs=node">Shared Access Signature</a>.
The configuration also contains an outgoing JavaScript payload mapping, which extracts the subject of the live message,
its timeout and its payload and uses this to construct a JSON message in the required direct method format.
You’ll see that format below.</p>
<h2 id="listen-for-direct-method-on-the-device">Listen for direct method on the device</h2>
<p>Your Azure IoT Hub device needs to listen to the direct method you’re calling. Imagine you want to call a
device method <code class="language-plaintext highlighter-rouge">getDeviceLog</code> on a device. You can use the Nodejs sample <a href="https://github.com/Azure/azure-iot-sdk-node/blob/f526f203ddc9ee32e3c92066312417d2ef6303de/device/samples/device_methods.js">device_methods.js from azure-iot-sdk-node/device/samples</a>
as a starter. You’ll need to set the <code class="language-plaintext highlighter-rouge">DEVICE_CONNECTION_STRING</code> environment variable to a connection string of the
device you are using and can run the device with <code class="language-plaintext highlighter-rouge">npm install && node device_methods.js</code>.</p>
<h2 id="send-a-live-message-to-the-thing">Send a live message to the Thing</h2>
<p>To invoke the <code class="language-plaintext highlighter-rouge">getDeviceLog</code> method on the device, you should now be able to send a live message to the Thing. The message
will be forwarded through your connection <code class="language-plaintext highlighter-rouge">Azure IoT Hub HTTP</code> to the Azure IoT Hub, which will route it to the device
and respond with its response.</p>
<p><code class="language-plaintext highlighter-rouge">POST</code> a message to <code class="language-plaintext highlighter-rouge"><ditto>/api/2/things/ditto:thing/inbox/messages/getDeviceLog?timeout=5s</code> with content:</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nl">"service"</span><span class="p">:</span><span class="w"> </span><span class="s2">"my-microservice"</span><span class="p">,</span><span class="w">
</span><span class="nl">"amount"</span><span class="p">:</span><span class="w"> </span><span class="mi">9000</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>The payload mapping of the connection will turn this into a direct method:</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nl">"methodName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"getDeviceLog"</span><span class="p">,</span><span class="w">
</span><span class="nl">"responseTimeoutInSeconds"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
</span><span class="nl">"payload"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"service"</span><span class="p">:</span><span class="w"> </span><span class="s2">"my-microservice"</span><span class="p">,</span><span class="w">
</span><span class="nl">"amount"</span><span class="p">:</span><span class="w"> </span><span class="mi">9000</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>If you didn’t change the sample code of the device, you should get a response containing <code class="language-plaintext highlighter-rouge">example payload</code>.</p>
<h1 id="azure-iot-hub-amqp">Azure IoT Hub AMQP</h1>
<p>For using the Azure IoT Hub AMQP endpoint, basically the same prerequisites as for the HTTP endpoint apply.
The difference is, that it’s not possible to invoke direct methods using the AMQP endpoint. Instead, you can
send a Cloud To Device (C2D) message, on which the device listens.</p>
<div class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> Instead of signing each request like in HTTP push connections, the connection itself is
established with signed connection information. For this, the <code class="language-plaintext highlighter-rouge">ttl</code> parameter of the <code class="language-plaintext highlighter-rouge">az-sasl</code> algorithm applies
(see <a href="connectivity-hmac-signing.html#az-sasl">documentation of the az-sasl algorithm</a>).</div>
<p>You can use the Nodejs sample <a href="https://github.com/Azure/azure-iot-sdk-node/blob/f526f203ddc9ee32e3c92066312417d2ef6303de/device/samples/simple_sample_device.js">simple_sample_device.js from azure-iot-sdk-node/device/samples</a>
to listen on C2D messages as a device. You’ll need to set the <code class="language-plaintext highlighter-rouge">DEVICE_CONNECTION_STRING</code> environment variable to a connection string of the
device you are using and can run the device with <code class="language-plaintext highlighter-rouge">npm install && node simple_sample_device.js</code>.</p>
<p>What follows is a sample connection JSON for a connection named <code class="language-plaintext highlighter-rouge">Azure IoT Hub AMPQ</code>, using hostname <code class="language-plaintext highlighter-rouge">my-hub.azure-devices.net</code> and
shared access policy <code class="language-plaintext highlighter-rouge">service</code> with key <code class="language-plaintext highlighter-rouge">theKey</code>. You can set the correct values from your Azure IoT Hub subscription
in the fields <code class="language-plaintext highlighter-rouge">uri</code>, <code class="language-plaintext highlighter-rouge">credentials.parameters.sharedKeyName</code>, <code class="language-plaintext highlighter-rouge">credentials.parameters.sharedKey</code> and
<code class="language-plaintext highlighter-rouge">credentials.parameters.endpoint</code>.</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"8caca8c6-10d1-4886-a61f-3ea6270f9d8e"</span><span class="p">,</span><span class="w">
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Azure IoT Hub AMQP"</span><span class="p">,</span><span class="w">
</span><span class="nl">"connectionType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"amqp-10"</span><span class="p">,</span><span class="w">
</span><span class="nl">"connectionStatus"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
</span><span class="nl">"uri"</span><span class="p">:</span><span class="w"> </span><span class="s2">"amqps://my-hub.azure-devices.net:5671"</span><span class="p">,</span><span class="w">
</span><span class="nl">"sources"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
</span><span class="nl">"targets"</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w">
</span><span class="nl">"address"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/messages/devicebound"</span><span class="p">,</span><span class="w">
</span><span class="nl">"topics"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"_/_/things/live/messages"</span><span class="p">],</span><span class="w">
</span><span class="nl">"authorizationContext"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"integration:ditto"</span><span class="p">],</span><span class="w">
</span><span class="nl">"headerMapping"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"iothub-ack"</span><span class="p">:</span><span class="w"> </span><span class="s2">"full"</span><span class="p">,</span><span class="w">
</span><span class="nl">"to"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/devices/{{thing:id}}/messages/devicebound"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nl">"clientCount"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
</span><span class="nl">"failoverEnabled"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"validateCertificates"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"processorPoolSize"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
</span><span class="nl">"credentials"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hmac"</span><span class="p">,</span><span class="w">
</span><span class="nl">"algorithm"</span><span class="p">:</span><span class="w"> </span><span class="s2">"az-sasl"</span><span class="p">,</span><span class="w">
</span><span class="nl">"parameters"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"sharedKeyName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"service"</span><span class="p">,</span><span class="w">
</span><span class="nl">"sharedKey"</span><span class="p">:</span><span class="w"> </span><span class="s2">"theKey"</span><span class="p">,</span><span class="w">
</span><span class="nl">"endpoint"</span><span class="p">:</span><span class="w"> </span><span class="s2">"my-hub.azure-devices.net"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>Instead of applying a payload mapping like in the HTTP example, the connection just sends the ditto protocol live message
and you should see its content on the device.</p>
<p><code class="language-plaintext highlighter-rouge">POST</code> a message to <code class="language-plaintext highlighter-rouge"><ditto>/api/2/things/ditto:thing/inbox/messages/C2DMessage?timeout=0</code> with content</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nl">"Hello"</span><span class="p">:</span><span class="w"> </span><span class="s2">"from Ditto"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>and see it arrive at the device.</p>
<div class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> Using the query parameter <code class="language-plaintext highlighter-rouge">timeout=0</code>, you can tell Ditto to not wait for an answer, since
devices can’t respond to C2D messages.</div>
<h1 id="azure-service-bus">Azure Service Bus</h1>
<p>This example shows how to send a message to an Azure Service Bus via Eclipse Ditto.</p>
<p>For creating signed requests against the Azure Service Bus, you’ll need the following information from your
Azure IoT Hub instance:</p>
<ul>
<li>A queue (e.g. <code class="language-plaintext highlighter-rouge">my-queue</code>).</li>
<li>The hostname (e.g. <code class="language-plaintext highlighter-rouge">my-bus.servicebus.windows.net</code>).</li>
<li>The name of a (Azure Service Bus) shared access policy, which has the <code class="language-plaintext highlighter-rouge">Send</code> and <code class="language-plaintext highlighter-rouge">Listen</code> permissions. By default, there
should be a policy named <code class="language-plaintext highlighter-rouge">RootManageSharedAccessKey</code> which provides this permission (but shouldn’t be used in production
scenarios).</li>
<li>The <code class="language-plaintext highlighter-rouge">Base64</code> encoded primary or secondary key of above policy. The signing will only work if you encode the key with
<code class="language-plaintext highlighter-rouge">Base64</code> (although it already has <code class="language-plaintext highlighter-rouge">Base64</code> encoding). E.g. if the primary key is <code class="language-plaintext highlighter-rouge">theKey</code>, you need to use its encoded
version <code class="language-plaintext highlighter-rouge">dGhlS2V5</code>.</li>
</ul>
<p>What follows is a sample connection JSON for a connection named <code class="language-plaintext highlighter-rouge">Azure Service Bus HTTP</code>, using hostname <code class="language-plaintext highlighter-rouge">my-bus.servicebus.windows.net</code> and
shared access policy <code class="language-plaintext highlighter-rouge">RootManageSharedAccessKey</code> with encoded key <code class="language-plaintext highlighter-rouge">dGhlS2V5</code> (<code class="language-plaintext highlighter-rouge">theKey</code>). You can set the correct values
from your Azure Service Bus subscription in the fields <code class="language-plaintext highlighter-rouge">uri</code>, <code class="language-plaintext highlighter-rouge">credentials.parameters.sharedKeyName</code>,
<code class="language-plaintext highlighter-rouge">credentials.parameters.sharedKey</code> and
<code class="language-plaintext highlighter-rouge">credentials.parameters.endpoint</code> (which is a combination of the hostname and queue name).</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"adec2846-4d11-4e0a-b456-d8bfc2192fc6"</span><span class="p">,</span><span class="w">
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Azure Service Bus HTTP"</span><span class="p">,</span><span class="w">
</span><span class="nl">"connectionType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http-push"</span><span class="p">,</span><span class="w">
</span><span class="nl">"connectionStatus"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
</span><span class="nl">"uri"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://my-bus.servicebus.windows.net:443"</span><span class="p">,</span><span class="w">
</span><span class="nl">"sources"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
</span><span class="nl">"targets"</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w">
</span><span class="nl">"address"</span><span class="p">:</span><span class="w"> </span><span class="s2">"POST:/my-queue/messages"</span><span class="p">,</span><span class="w">
</span><span class="nl">"topics"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"_/_/things/live/messages"</span><span class="p">],</span><span class="w">
</span><span class="nl">"authorizationContext"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"integration:ditto"</span><span class="p">],</span><span class="w">
</span><span class="nl">"issuedAcknowledgementLabel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"live-response"</span><span class="p">,</span><span class="w">
</span><span class="nl">"headerMapping"</span><span class="p">:</span><span class="w"> </span><span class="p">{}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="nl">"clientCount"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
</span><span class="nl">"failoverEnabled"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"validateCertificates"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"processorPoolSize"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
</span><span class="nl">"specificConfig"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"parallelism"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"credentials"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hmac"</span><span class="p">,</span><span class="w">
</span><span class="nl">"algorithm"</span><span class="p">:</span><span class="w"> </span><span class="s2">"az-sasl"</span><span class="p">,</span><span class="w">
</span><span class="nl">"parameters"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"sharedKeyName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"RootManageSharedAccessKey"</span><span class="p">,</span><span class="w">
</span><span class="nl">"sharedKey"</span><span class="p">:</span><span class="w"> </span><span class="s2">"dGhlS2V5"</span><span class="p">,</span><span class="w">
</span><span class="nl">"endpoint"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://my-bus.servicebus.windows.net/my-queue"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>This connection configuration sends live messages to the endpoint at <code class="language-plaintext highlighter-rouge">https://my-hub.servicebus.windows.net.net:443/my-queue/messages</code>
and signs each request with a <a href="https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-sas#overview-of-sas">Shared Access Signature</a>.</p>
<h2 id="listen-for-the-message">Listen for the message</h2>
<p>To listen for the message you send into the Service Bus, you can use the Nodejs sample
<a href="https://github.com/Azure/azure-sdk-for-js/blob/d7d67ccc865318f3dc6395e0db6997b5af8cf5e8/sdk/servicebus/service-bus/samples/v7/javascript/receiveMessagesStreaming.js">receiveMessagesStreaming.js from azure-sdk-for-js/sdk/servicebus/service-bus/samples/v7/javascript</a>.
You’ll need to set the <code class="language-plaintext highlighter-rouge">SERVICEBUS_CONNECTION_STRING</code> environment variable to the connection string of the used
shared access policy. Also, you’ll need to set the <code class="language-plaintext highlighter-rouge">QUEUE_NAME</code> environment variable to the
used queue (e.g. <code class="language-plaintext highlighter-rouge">my-queue</code>). You should be able to run the sample using <code class="language-plaintext highlighter-rouge">npm install && node receiveMessagesStreaming.js</code>.</p>
<h2 id="send-a-live-message-to-the-thing-1">Send a live message to the Thing</h2>
<p>To send a message to Service Bus, you can simply send a live message to a Thing. The message
will be forwarded through your connection <code class="language-plaintext highlighter-rouge">Azure Service Bus HTTP</code> to the Azure Service Bus, from which the sample
app can read the message.</p>
<p><code class="language-plaintext highlighter-rouge">POST</code> a message to <code class="language-plaintext highlighter-rouge"><ditto>/api/2/things/ditto:thing/inbox/messages/HelloServiceBus</code> with content:</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nl">"Hello"</span><span class="p">:</span><span class="w"> </span><span class="s2">"from Ditto"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>If you didn’t change the sample code you should see the message arriving there.</p>
<h2 id="feedback">Feedback?</h2>
<p>Find details on the different algorithms and their parameters at
<a href="connectivity-hmac-signing.html">Connectivity API > HMAC request signing</a>.</p>
<p>Please <a href="feedback.html">get in touch</a> if you have feedback or questions regarding this new functionality.</p>
<p><br />
<br /></p>
<figure><img class="docimage" src="images/ditto.svg" alt="Ditto" style="max-width: 500px" /></figure>
<p>–<br />
The Eclipse Ditto team</p>
</div>
</article>
<hr class="shaded"/>
<footer>
<div class="row">
<div class="col-lg-12 footer">
<div class="logo">
<a href="https://eclipse.org"><img src="images/eclipse_foundation_logo.svg" alt="Eclipse logo"/></a>
</div>
<p class="notice">
©2024 Eclipse Ditto™.
Site last generated: Nov 27, 2024 <br />
</p>
<div class="quickLinks">
<a href="https://www.eclipse.org/legal/privacy.php" target="_blank">
> Privacy Policy
</a>
<a href="https://www.eclipse.org/legal/termsofuse.php" target="_blank">
> Terms of Use
</a>
<a href="https://www.eclipse.org/legal/copyright.php" target="_blank">
> Copyright Agent
</a>
<a href="https://www.eclipse.org/legal" target="_blank">
> Legal
</a>
<a href="https://www.eclipse.org/legal/epl-2.0/" target="_blank">
> License
</a>
<a href="https://eclipse.org/security" target="_blank">
> Report a Vulnerability
</a>
</div>
</div>
</div>
</footer>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
<!-- /#main -->
</div>
</body>
</html>