App development
Create an app
Create a support ticket
Search…
Overview
Quick start
Changelog
Platform concepts
Apps
Extensions
Regions
Authentication
Deprecation policy
Extensions
Content extensions
Editing extensions
Publish extensions
Frontend development
Assets
Development URL
Error handling
Localization
Notifications
Rich controls
JSX
WebGL
Backend development
Base URL
Continuation
Signature verification
Client secret
Decode a client secret
Regenerate a client secret
Verify POST request signatures
Verify GET request signatures
Verify timestamp
Test signature verification
SDKs
Distribution
UX guidelines
Submission checklist
Creating the App Directory listing
Client API
EditingExtensionClient.API
CanvaDataType
CanvaElement
CanvaElementLayout
CanvaImageBlob
CanvaImageHelpers
CanvaImageUrl
CanvaMedia
init
Server API
Overview
GET /apps/configured
POST /configuration
POST /configuration/delete
POST /content/resources/find
POST /editing/image/process
POST /editing/image/process/get
POST /publish/resources/find
POST /publish/resources/get
POST /publish/resources/upload
Redirect URL
Reference
Locales
Powered By
GitBook
Decode a client secret
Learn how to convert a string into a byte array.
To calculate a
request signature
, an extension must decode the app's
client secret
into a byte array. This page demonstrates how to decode a client secret with a few different programming languages.
Go
1
package
main
2
​
3
import
(
4
b64
"encoding/base64"
5
"fmt"
6
"log"
7
)
8
​
9
func
main
()
{
10
secret
:=
"CLIENT SECRET GOES HERE"
11
key
,
error
:=
:=
b64
.
StdEncoding
.
DecodeString
(
secret
)
12
​
13
if
error
!=
nil
{
14
log
.
Fatal
(
error
)
15
}
16
​
17
fmt
.
Println
(
key
)
18
}
Copied!
Java
1
import
java
.
util
.
Base64
;
2
​
3
public
class
Example
{
4
public
static
void
main
(
String
[]
args
)
{
5
String
secret
=
"CLIENT SECRET GOES HERE"
;
6
byte
[]
key
=
Base64
.
getDecoder
().
decode
(
secret
);
7
System
.
out
.
println
(
key
);
8
}
9
}
Copied!
JavaScript
1
const
secret
=
"CLIENT SECRET GOES HERE"
;
2
const
key
=
Buffer
.
from
(
secret
,
"base64"
);
3
console
.
log
(
key
);
Copied!
PHP
1
$secret
=
"CLIENT SECRET GOES HERE"
;
2
$key
=
base64_decode
(
$secret
);
3
echo
(
$key
);
Copied!
Python
1
import
base64
2
secret
=
"CLIENT SECRET GOES HERE"
3
key
=
base64
.
b64decode
(
secret
)
4
print
(
key
)
Copied!
Ruby
1
require
"base64"
2
secret
=
"CLIENT SECRET GOES HERE"
3
key
=
Base64
.
decode64
(
secret
)
4
puts key
Copied!
TypeScript
1
const
secret
=
"CLIENT SECRET GOES HERE"
;
2
const
key
=
Buffer
.
from
(
secret
,
"base64"
);
3
console
.
log
(
key
);
Copied!
Previous
Client secret
Next
Regenerate a client secret
Last modified
7mo ago
Copy link
Contents
Go
Java
JavaScript
PHP
Python
Ruby
TypeScript