Skip to content

Commit

Permalink
chore: Indicate hmac_token needs to be replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrajs committed Jul 21, 2021
1 parent 864b0e7 commit 9936be2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/product/channels/live-chat/sdk/identity-validation.md
Expand Up @@ -16,8 +16,8 @@ You can generate HMAC in different languages as shown below.
```php
<?php

$key = 'webwidget.hmac_token';
$message = 'identifier';
$key = '<webwidget-hmac-token>';
$message = '<identifier>';

$identifier_hash = hash_hmac('sha256', $message, $key);
?>
Expand All @@ -28,8 +28,8 @@ $identifier_hash = hash_hmac('sha256', $message, $key);
```js
const crypto = require('crypto');

const key = 'webwidget.hmac_token';
const message = 'identifier';
const key = '<webwidget-hmac-token>';
const message = '<identifier>';

const hash = crypto.createHmac('sha256', key).update(message).digest('hex');
```
Expand All @@ -40,17 +40,17 @@ const hash = crypto.createHmac('sha256', key).update(message).digest('hex');
require 'openssl'
require 'base64'

key = 'webwidget.hmac_token'
message = 'identifier'
key = '<webwidget-hmac-token>'
message = '<identifier>'

OpenSSL::HMAC.hexdigest('sha256', key, message)
```

### Elixir

```elixir
key = 'webwidget.hmac_token'
message = 'identifier'
key = '<webwidget-hmac-token>'
message = '<identifier>'

signature = :crypto.hmac(:sha256, key, message)

Expand All @@ -70,8 +70,8 @@ import (
)

func main() {
secret := []byte("webwidget.hmac_token")
message := []byte("identifier")
secret := []byte("<webwidget-hmac-token>")
message := []byte("<identifier>")

hash := hmac.New(sha256.New, secret)
hash.Write(message)
Expand All @@ -86,8 +86,8 @@ import hashlib
import hmac
import base64

secret = bytes('webwidget.hmac_token', 'utf-8')
message = bytes('identifier', 'utf-8')
secret = bytes('<webwidget-hmac-token>', 'utf-8')
message = bytes('<identifier>', 'utf-8')

hash = hmac.new(secret, message, hashlib.sha256)
hash.hexdigest()
Expand Down

0 comments on commit 9936be2

Please sign in to comment.