mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-18 13:14:56 +01:00
Fixed JWT and added tests for the gatekeeper
This commit is contained in:
@@ -7,7 +7,7 @@ invoke_cyphernode()
|
||||
local action=${1}
|
||||
local post=${2}
|
||||
|
||||
local p64=$(echo -n "{\"id\":\"${id}\",\"exp\":$((`date +"%s"`+10))}" | base64)
|
||||
local p64=$(echo -n '{"id":"'${id}'","exp":'$((`date +"%s"`+10))'}' | basenc --base64url | tr -d '=')
|
||||
local s=$(echo -n "$h64.$p64" | openssl dgst -hmac "$key" -sha256 -r | cut -sd ' ' -f1)
|
||||
local token="$h64.$p64.$s"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user