简体   繁体   中英

Get Video Channel List from Office 365 using windows authentication : C#

I have to get list of video channels and videos details from office 365. I referred to this link

But, What I want to achieve is, that a user will login to the site using windows authentication.

var onlineCredentials = new SharePointOnlineCredentials(username,password);
ClientContext context_new =
    new ClientContext("https://xxx.sharepoint.com//portals/hub/_api/VideoService/Channels");
context_new.Credentials = onlineCredentials;`

The above code I have used to get a list from SharePoint.

Is it possible to use above method to authenticate office 365, to get details about Video Channels and Videos.

Or

Should I use an accesstoken ?

Video portal is only available with Office 365 and in office 365 authentication can be done only with Azure AD. I assume you will have your organization AD getting Synched with Azure AD of Office 365.

If i understand your requirement correct, you want to have a stand alone Web App which needs to get the details from Office 365 Video Portal. For this probably you'll have to register your app to Azure AD to get access of the Video Portal REST APIs. Following is the link. https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually

However, for the above approach, users will have to login with Azure AD only. If you want to use windows credentials, probably what you can do is you can use a middle layer of WebAPI which is registered with Azure AD. Again Web Api would also have to get Application Delegation Permissions so that any user can get access of video portal(doesn't sound like a great approach but is possible).

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