Login user with MS Teams bot

心不动则不痛 提交于 2019-12-08 12:00:01

问题


I'm working on a bot using the MS Botframework and trying to use a signin card with MS Teams. I can get the signin card to show up in Teams as expected, but clicking the sign in button doesn't do anything.

Any ideas what is going on here? I can't find much documentation about how to sign in a user for a session with the bot.

I'm using the Nodejs botbuilder library.

My code:

bot.dialog('/signin', [
    function (session) { 
        var msg = new builder.Message(session)
            .attachments([
                new builder.SigninCard(session)
                    .text('You need to sign in to Bonusly to continue')
                    .button('Sign In', 'https://myapp.com/users/sign_in_start')
            ]);
        session.endDialog(msg);
    }
]);

回答1:


Currently MS Teams supports Sign-In cards but only if the action for the button is specified as 'open url' as stated in this Microsoft document. It's probably failing because you specified the button action to be 'Sign In' in your line:

.button('Sign In', 'https://myapp.com/users/sign_in_start')

Also check out this github issue that talks further about this.



来源:https://stackoverflow.com/questions/41230680/login-user-with-ms-teams-bot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!