Login user with MS Teams bot

937 views Asked by At

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

There are 1 answers

0
Megan On

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.