简体   繁体   中英

Azure Chat bot--Adaptive card -show secured video

I am using Microsoft virtual Assistant Template to create my Chat BoT. want to show show video within my azure chat bot..But videos are not working especially when the video is from corp sharepoint locations. I guess this is due to authentication issues. How can I send logged in user tokens to show video inside my chat window.

public static VideoCard GetVideoCard()
    {
        var videoCard = new VideoCard
        {
            Title = "This my Title",
            Subtitle = "by the subtitle",
            Text = "t is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.  distribution of letters,." +
                   " t is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.ution of letters,.",

            Image = new ThumbnailUrl
            {
                Url = "https://mycompany.rev.vbrick.com/#/videos/11111-db89-11111-b39d-111111",
            },

            Media = new List<MediaUrl>
            {
                new MediaUrl()
                {

                    Url="https://mycompany.rev.vbrick.com/#/videos/11111-db89-4bc3-b39d-111111",

                },
            },
            Buttons = new List<CardAction>
            {
                new CardAction()
                {
                    Title = "Learn More",
                    Type = ActionTypes.OpenUrl,
                    Value = "https://mycompany.rev.vbrick.com/#/videos/1111-db89-4bc3-b39d-1111",
                },
            },
        };

        return videoCard;
    }

You have to use OAuth , which is supported by vBrick .

Basically, the steps will be:

  1. Present login screen to the user ( here's a good sample )

  2. Once the user is logged in, all HTTP requests they make are authenticated. So long as you can get vBrick's OAuth working in Azure, it should work. I can't test, since vBrick isn't a free service.

  3. Since VideoCard video requests are made client-side as the user, it should work.


For anybody that comes across this and wants to use a video from OneDrive (which is how I tested), OneDrive authenticates the URL and then redirects you to a public download URL. Since redirects don't work within Video Cards, the best way is to use the MS Graph API, get all OneDrive Items , and use the "@microsoft.graph.downloadUrl" . Set the VideoCard's URL to that downloadUrl , then send the VideoCard to the user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM