I have a problem with starting my bot from emulator - BotFrameworkAdapter.processActivity(): 401 ERROR - NotBeforeError: jwt not active
I have a problem with starting my bot from emulator - BotFrameworkAdapter.processActivity(): 401 ERROR - NotBeforeError: jwt not active
我正在为 Node.js.
使用 Microsoft Bot Framework 开发一个机器人
我用新的 .bot 文件更改了 LUIS 应用程序,然后生成了一个新的 botFileSecret,我使用 Bot Framework Emulator 在本地测试了我的机器人,一切正常。
然后,我得到了这个错误:
Error finding key for token.
Available keys: -----BEGIN RSA PUBLIC KEY-----
jwtTokenExtractor.ts:132
MIIBCgKCAQEAt3J1hnS4aRZaZGq5JUw1iKsHynCUV9lMBe2MDArXGeQlN+w8Xw9v
U6InqmPVvJsUVyUkKE0jzn4dYLcwbTuttQ0hmN+lzNfGol04KKMIVdtTs1P0wo/+
VyJ88EuWM3lvDxyTw1PLim14UJ1856zdp2/kZLOSy+B46K96ENJ8b2yCP/VHRTd3
...
-----END RSA PUBLIC KEY-----
JwtTokenExtractor.getIdentity:err!
jwtTokenExtractor.ts:69
NotBeforeError {name: "NotBeforeError", message: "jwt not active", date: Tue Apr 02 2019 09:58:08 GMT+0200 (Romance Dayligh…, stack: "NotBeforeError: jwt not active
at Object.modul…"}
jwtTokenExtractor.ts:69
BotFrameworkAdapter.processActivity(): 401 ERROR - NotBeforeError: jwt not active
botFrameworkAdapter.ts:555
(node:1888) UnhandledPromiseRejectionWarning: Error: NotBeforeError: jwt not active
warning.js:18
at BotFrameworkAdapter.processActivity (c:\Users\SP-Montassar\Desktop\quicktext\zoe2\node_modules\botbuilder\src\botFrameworkAdapter.ts:556:19)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
(node:1888) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
warning.js:18
(node:1888) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
经过研究,我在 Bot Framework Docs 上找到 this article 解释如何解决 bot 身份验证。
我跟进了步骤..
首先我从Azure Portal验证了App ID和App Password,然后我删除了APP ID和App Password。我已经确认该机器人可以正常启动。我通过命令行发送了这个 HTTP 请求来检查身份验证:
curl -X POST \
https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id=<APP_ID>&client_secret=<APP_PWD>&scope=https://api.botframework.com/.default'
我收到了包含有效访问令牌的回复:
{
"token_type": "Bearer",
"expires_in": 3600,
"ext_expires_in": 3600,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGGAKI..."
}
然后,我在教程的第三步就卡住了,因为我还是出现上面的一些错误
对这个问题有什么帮助吗?
只需为 .bot 文件创建一个新的 botFileSecret 即可解决此问题。
对于遇到相同错误的任何其他人:NotBeforeError: jwt not active
,如果当前时间早于 nbf 声明,则会抛出此错误。
比较您环境中的日期,backend/frontend 视情况而定..
我正在为 Node.js.
使用 Microsoft Bot Framework 开发一个机器人我用新的 .bot 文件更改了 LUIS 应用程序,然后生成了一个新的 botFileSecret,我使用 Bot Framework Emulator 在本地测试了我的机器人,一切正常。
然后,我得到了这个错误:
Error finding key for token.
Available keys: -----BEGIN RSA PUBLIC KEY-----
jwtTokenExtractor.ts:132
MIIBCgKCAQEAt3J1hnS4aRZaZGq5JUw1iKsHynCUV9lMBe2MDArXGeQlN+w8Xw9v
U6InqmPVvJsUVyUkKE0jzn4dYLcwbTuttQ0hmN+lzNfGol04KKMIVdtTs1P0wo/+
VyJ88EuWM3lvDxyTw1PLim14UJ1856zdp2/kZLOSy+B46K96ENJ8b2yCP/VHRTd3
...
-----END RSA PUBLIC KEY-----
JwtTokenExtractor.getIdentity:err!
jwtTokenExtractor.ts:69
NotBeforeError {name: "NotBeforeError", message: "jwt not active", date: Tue Apr 02 2019 09:58:08 GMT+0200 (Romance Dayligh…, stack: "NotBeforeError: jwt not active
at Object.modul…"}
jwtTokenExtractor.ts:69
BotFrameworkAdapter.processActivity(): 401 ERROR - NotBeforeError: jwt not active
botFrameworkAdapter.ts:555
(node:1888) UnhandledPromiseRejectionWarning: Error: NotBeforeError: jwt not active
warning.js:18
at BotFrameworkAdapter.processActivity (c:\Users\SP-Montassar\Desktop\quicktext\zoe2\node_modules\botbuilder\src\botFrameworkAdapter.ts:556:19)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
(node:1888) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
warning.js:18
(node:1888) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
经过研究,我在 Bot Framework Docs 上找到 this article 解释如何解决 bot 身份验证。
我跟进了步骤..
首先我从Azure Portal验证了App ID和App Password,然后我删除了APP ID和App Password。我已经确认该机器人可以正常启动。我通过命令行发送了这个 HTTP 请求来检查身份验证:
curl -X POST \
https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id=<APP_ID>&client_secret=<APP_PWD>&scope=https://api.botframework.com/.default'
我收到了包含有效访问令牌的回复:
{
"token_type": "Bearer",
"expires_in": 3600,
"ext_expires_in": 3600,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGGAKI..."
}
然后,我在教程的第三步就卡住了,因为我还是出现上面的一些错误
对这个问题有什么帮助吗?
只需为 .bot 文件创建一个新的 botFileSecret 即可解决此问题。
对于遇到相同错误的任何其他人:NotBeforeError: jwt not active
,如果当前时间早于 nbf 声明,则会抛出此错误。
比较您环境中的日期,backend/frontend 视情况而定..