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
package mainimport (b64 "encoding/base64""fmt""log")func main() {secret := "CLIENT SECRET GOES HERE"key, error := := b64.StdEncoding.DecodeString(secret)if error != nil {log.Fatal(error)}fmt.Println(key)}
go
Java
import java.util.Base64;public class Example {public static void main(String[] args) {String secret = "CLIENT SECRET GOES HERE";byte[] key = Base64.getDecoder().decode(secret);System.out.println(key);}}
java
JavaScript
const secret = "CLIENT SECRET GOES HERE";const key = Buffer.from(secret, "base64");console.log(key);
javascript
PHP
$secret = "CLIENT SECRET GOES HERE";$key = base64_decode($secret);echo($key);
php
Python
import base64secret = "CLIENT SECRET GOES HERE"key = base64.b64decode(secret)print(key)
python
Ruby
require "base64"secret = "CLIENT SECRET GOES HERE"key = Base64.decode64(secret)puts key
ruby
TypeScript
const secret = "CLIENT SECRET GOES HERE";const key = Buffer.from(secret, "base64");console.log(key);
javascript