Spotify-如何/在何处生成ENCRYPTION_SECRET?

时间:2018-09-10 14:24:38

标签: javascript node.js spotify spotify-app

我正在尝试实现此插件https://github.com/Festify/cordova-spotify-oauth

https://github.com/Festify/cordova-spotify-oauth/blob/develop/oauth-token-api/spotifyTokenService.js

CLIENT_ID="got from spotify dev account"
CLIENT_SECRET="got from spotify dev account"
CLIENT_CALLBACK_URL="my-app://callback"
ENCRYPTION_SECRET="<Secret used to encrypt the refresh token - please generate>"

在上述env变量中,无论我在 ENCRYPTION_SECRET 中输入什么内容,它总是会引发错误,如下所示:

TypeError: Bad input string
    at TypeError (native)
    at Decipher.update (crypto.js:146:26)
    at Object.module.exports.decrypt (/user_code/lib/crypto.js:14:21)
    at exports.refreshToken.functions.https.onRequest (/user_code/index.js:104:31)
    at cloudFunction (/user_code/node_modules/firebase-functions/lib/providers/https.js:37:41)
    at /var/tmp/worker/worker.js:689:7
    at /var/tmp/worker/worker.js:673:9
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)

我尝试过:

  • ENCRYPTION_SECRET = 123
  • ENCRYPTION_SECRET = cFJLyifeUJUBFWdHzVbykfDmPHtLKLGzViHW9aHGmyTLD8hGXC (只是随机文本)
  • 也在Spotify开发人员帐户中搜索,未找到任何生成ENCRYPTION_SECRET的选项

谢谢。

1 个答案:

答案 0 :(得分:0)

加密密钥可以是任何您想要的密钥,它只是确保刷新令牌通信安全的密钥。