Trying to deploy a bot developed in MS bot framework v4.0 on SharePoint online page. Users need to login to SharePoint to access the bot, therefore, can't add an authentication at bot level as users have to login twice that will result in poor user experience.
Integration is done with the help of token fetched by calling Web Chat Bot connector API with Web Chat channel 'Security Key'. Followed Option 1 in the documentation.
Issue
SharePoint being a client-side app poses a threat of channel 'Security Key' being exposed i.e. it can be fetched in browser's developer tools and can be used to integrate our bot on their website.
I have already Tried
- Minify the javascript and add it to the web part, it makes it difficult to read 'Security Key' but not impossible.
- Single Sigh-On(SSO), SSO is not possible without an OAutCard at bot level, so trying to avoid it.
- Create a trigger/ function app to hide bot connector rest call and only expose token but it requires some additional cost on resources.
- I did not find a way to pass SharePoint logged in user context or token from SharePoint to the bot.
Expectation
- To secure channel 'Security Key' so that it can't be accessed in the developer tool. or
- Find a way to pass SharePoint logged in user context or token from SharePoint to the bot and validate the same at the bot end. or
- Hide the rest call to bot connector API through a free trigger in SharePoint online.
Open to any other solution or suggestion as well.