botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Test connection to Bot shows Unauthorised on On-prem endpoint url

Open Kothakapu opened this issue 9 years ago • 6 comments

Test connection to Bot works fine with Azure hosted endpoint url but same is showing Unauthorised when I'm trying to host it on local server with valid SSL certificate.

Below are few details for reference. IIS version - 8.5.9600.16384 Bot version - V3 Window server 2012 r2 Standard

Please help me on this.

Kothakapu avatar Jan 16 '17 11:01 Kothakapu

Hi @Kothakapu, can you send your bot handle or MSA app ID and I can take a look?

dandriscoll avatar Jan 16 '17 16:01 dandriscoll

Bot handle : AbbieCass Bot Framework Version : 3.0 Messaging endpoint https://acuvatesolutions.com:2124/api/messages/ Microsoft App ID 6c9363d4-9913-4d7e-b9a4-76a41ecc14f6

Kothakapu avatar Jan 16 '17 16:01 Kothakapu

Hi @Kothakapu, it looks like the connection is working.

Your server's certificate is valid and we're able to connect to the endpoint. When we send a request, we receive an HTTP 401 (Unauthorized) response.

dandriscoll avatar Jan 16 '17 17:01 dandriscoll

Hi @dandriscoll , thanks for your update. Now I'm able to host it on local server :)

I achieved this by commenting [BotAuthentication] attribute in Message controller class and used MicrosoftAppCredentials(MicrosoftAppId,MicrosoftAppPassoward) object to authenticate ConnectorClient.

Could you please share your thoughts and comments about this approach.

Kothakapu avatar Jan 20 '17 17:01 Kothakapu

Hi @Kothakapu, removing the BotAuthentication attribute disables inbound auth completely, and is not a recommended approach. Anyone who knows your bot's endpoint could impersonate users on trusted channels.

An HTTP 401 indicates the Authorization header is either missing or malformed. Is there something in your HTTP stack (firewall, proxy?) that could be stripping this header?

dandriscoll avatar Jan 25 '17 06:01 dandriscoll

@dandriscoll I have a similar problem; my bot isn't replying to messages when I text it after I publishing my app.

Here are my bot things: Bot Id: mcdonaldsbot App Id: 6c41c34e-0907-4db9-bdef-3ab73fa363aa Messaging Endpoint: https://mcdonaldsbot.azurewebsites.net/api/messages

mahmoudahmedarafa avatar Jul 14 '17 00:07 mahmoudahmedarafa