Я использую пакет Botbuilder для создания адаптера. >
Код: Выделить всё
credentialsFactory = new MsalServiceClientCredentialsFactory(
'APP_ID',
new ConfidentialClientApplication({
auth: {
clientId: 'APP_ID',
clientSecret: 'APP_PASSWORD',
authority: 'https://login.microsoftonline.com/botframework.com',
},
}),
);
const httpsProxyAgent = getHttpsProxyAgent();
const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication(
undefined,
credentialsFactory,
undefined,
undefined,
{
proxySettings: httpsProxyAgent
? {
host: httpsProxyAgent.proxy.hostname,
port: +httpsProxyAgent.proxy.port,
}
: undefined,
},
);
const adapter = new CloudAdapter(botFrameworkAuthentication);
await adapter.process(req, res, async (context) => {
// Do something
await context.sendActivity(await response.component.GetMessage({
userSession,
userMessage,
template,
responseMessageOverride: null,
}));
});
Мы использовали следующий образец для настройки Proxy: https://github.com/microsoft/botbuilder ... pt_nodejs/ 49.echo-proxy-bot/index.js
Теперь мы получаем следующее Ошибка: < /p>
err: {
"type": "ClientAuthError",
"message": "network_error: Network request failed",
"stack":
ClientAuthError: network_error: Network request failed
at createClientAuthError (file:///opt/app-root/src/node_modules/.pnpm/@azure+msal-common@14.16.0/node_modules/@azure/msal-common/dist/error/ClientAuthError.mjs:255:12)
at ClientCredentialClient.sendPostRequest (file:///opt/app-root/src/node_modules/.pnpm/@azure+msal-common@14.16.0/node_modules/@azure/msal-common/dist/client/BaseClient.mjs:131:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ClientCredentialClient.executePostToTokenEndpoint (file:///opt/app-root/src/node_modules/.pnpm/@azure+msal-common@14.16.0/node_modules/@azure/msal-common/dist/client/BaseClient.mjs:82:26)
at async ClientCredentialClient.executeTokenRequest (file:///opt/app-root/src/node_modules/.pnpm/@azure+msal-node@2.16.2/node_modules/@azure/msal-node/dist/client/ClientCredentialClient.mjs:155:30)
at async ConfidentialClientApplication.acquireTokenByClientCredential (file:///opt/app-root/src/node_modules/.pnpm/@azure+msal-node@2.16.2/node_modules/@azure/msal-node/dist/client/ConfidentialClientApplication.mjs:112:20)
"errorCode": "network_error",
"errorMessage": "Network request failed",
"subError": "",
"name": "ClientAuthError",
"correlationId": "REDACTED"
}
< /code>
Я попробовал запустить приложение на моем персональном компьютере, и оно работает. Я полагаю, где -то где -то отсутствует конфигурация прокси, но я не могу понять. Есть ли еще одна конфигурация, необходимая для Botframework для использования настройки прокси при подключении к Azure?
Подробнее здесь: https://stackoverflow.com/questions/794 ... botframewo
Мобильная версия