Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit d594a70

Browse files
committed
Added JWT section
1 parent b98b83f commit d594a70

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/views/docs/service.phtml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ $paramSDK = (!empty($sdk)) ? '?sdk='.$sdk : '';
241241
$rateKey = $operation['rateKey'] ?? '';
242242
$scope = $operation['scope'] ?? '';
243243
$snippet = $operation['snippet'] ?? '';
244+
$security = $operation['security'][0] ?? '';
244245
$platformsList = (isset($operation['platforms'])) ? array_map(function($node) {return 'example-for-'.$node;}, $operation['platforms']) : [];
245246

246247
usort($parameters, function ($a, $b) {
@@ -299,7 +300,13 @@ $paramSDK = (!empty($sdk)) ? '?sdk='.$sdk : '';
299300
<div class="margin-bottom-large">
300301
<h3 class="margin-bottom margin-top-small">Authentication</h3>
301302

302-
<p>To access this route, init your SDK with your project unique ID and <a href="/docs/keys" target="_blank">API Key</a> secret token. Make sure your API Key is granted with access to the <u>"<?php echo $scope; ?>"</u> permission scope.</p>
303+
<?php if(array_key_exists('Key', $security) && array_key_exists('JWT', $security)): ?>
304+
<p>To access this route, init your SDK with your project unique ID and <a href="/docs/keys" target="_blank">API Key</a> secret token. Make sure your API Key is granted with access to the <u>"<?php echo $scope; ?>"</u> permission scope. You can also authenticate using a valid <a href="/docs/client/account#accountCreateJWT" target="_blank">JWT</a> and perform actions on behalf of your user.</p>
305+
<?php elseif(array_key_exists('Key', $security)): ?>
306+
<p>To access this route, init your SDK with your project unique ID and <a href="/docs/keys" target="_blank">API Key</a> secret token. Make sure your API Key is granted with access to the <u>"<?php echo $scope; ?>"</u> permission scope.</p>
307+
<?php elseif(array_key_exists('JWT', $security)): ?>
308+
<p>To access this route, init your SDK with your project unique ID and a valid JWT. Using the <a href="/docs/client/account#accountCreateJWT" target="_blank">JWT</a> authentication you will be able to perform API actions on behalf of your user.</p>
309+
<?php endif; ?>
303310
</div>
304311
<?php endif; ?>
305312

0 commit comments

Comments
 (0)