I want to upload files to a specific folder on my onedrive using C# in web application. I am not able to find any sdk for that. All i can find is sdk for windows phone application. Thanks you in advance.
The OneDrive SDK is still valid for use in any .NET language/platform, including ASP.NET.
For web-based applications, you'll need to handle authentication yourself though. Because of the various ways of authentication a web app, the SDK didn't provide a prescriptive authentication solution for web apps.
You can either code the OAuth 2 implementation or use an existing library to connect it up (like using OWIN). Once you have an access token for OneDrive, you can provide the token to the SDK and then use the SDK as normal.
The webhook sample project in the OneDrive org has an example of how to provide an access token directly to the OneDrive SDK by way of creating a OneDriveAccountServiceProvider.
Related
I am working on Xamarin.Android app that needs to download documents from SharePoint Online (SPO) in the background thread (using SPO REST API right now). Users should be using an app, while it is quietly retrieving documents from SPO.
I have no experience working with Intune MDM or MSAL library for authentication. Android device is corporate-owned (COD) and enrolled in MS InTune. Is there a way to pick enrolled on-device user details and pass them with requests to SPO?
Options that I am investigating are:
Integrate InTune SDK into app
Use MSAL library with the app registration in Azure portal for authentication
I am trying to avoid using WebView/browser for SSO if possible at all.
It looks like there are no experts here in this field, so after a lot of research and trials I worked out the solution. InTune SDK integration is not required if an Android mobile device is enrolled through InTune MDM, because Microsoft Authentication Library (MSAL.NET) can use Intune Company Portal app (or Microsoft Authenticator) as a broker. Your Xamarn.Android app needs to be registered in Azure portal following these steps https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app and adopting steps in this https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-android-single-sign-on tutorial to Xamarin.Android makes authentication work.
One point to note is that you need to specify and give admin consent for Graph and Sharepoint permissions to read User, Sites and Files.
I want to know if it is possible to use office 365 API to interact with word documents in office 365 (create, update, and download). I have an azure directory setup, but I don't know how to leverage it to access the office 365 api to interact with these documents.
What is the process, if any, for using azure active directory combined with office 365 to manage documents? All of the resources I can find assume azure active directory will be used to handle authentication for a web service / web app. I wish to do this from a console app.
It is not necassary for me to use azure active directory, my only goal is to authenticate and interact with office 365 online word documents, so if there is someway to simply obtain a token directly through office 365 to manage word documents, that will solve my issue too.
You can use both ADAL or MSAL on a console based application and interact with Office documents using Graph API: The OneDrive workload in Graph API allows you to retrieve, download, upload documents from a OneDrive/ OneDrive for Business or SharePoint Document Library.
Below some resources/ samples that you can use as references:
GitHub Sample: Call the Azure AD Graph API from a native client (ADAL) - Sample application to show how to sign-in and query a Graph API in the context of the user and the application
Call Graph from Windows Desktop (MSAL) - A simple guide shows how to call a Graph API via REST on a .NET Desktop app - the same can be done with a console based app.
Service apps - Show more information on how to query AAD (using MSAL) on a context of an application (instead of a user).
I have been looking all over the place but I'm having a hard time finding out how to upload a file to Dropbox from an Azure webjob. Is this even possible? I will be creating an excel file and a text document in my webjob that i will need to place in a certain Dropbox account (which i have access) folder.
According to your requirement, I assumed that you could follow the possible approaches below to achieve your purpose.
1.Call Dropbox API in your WebJob
You could leverage Dropbox.NET which is a portable Class Library for you to easily integrate Dropbox into your WebJob.
2. ApiHub extension for Azure WebJob
You could leverage Microsoft.Azure.WebJobs.Extensions.ApiHub which is a pre-release version for you to integrate Dropbox with WebJob. For more details, you could refer to Azure WebJobs extensions sample.
Alternatively (if you don't want to deal with DropBox API) you can build a logic app being triggered for example by HTTP request from your web job as DropBox connector exists:
https://learn.microsoft.com/en-us/azure/connectors/connectors-create-api-dropbox
I have an in-house CMS system written in ASP.NET C#, and I need to implement a few pages that can allow the user to access and alter their Google Analytics management settings using the Google Analytics management API.
I have added the Google.Apis.Analytics.v3 library from NuGet, and I managed to make it work using OAuth2 authentication.
However, the library installs several dependencies, and some of them are upgrading some of my existing DLL files. This is not good, because I have a lot of functionality in this solution and some other solutions that are based on these old DLLs.
Would it be possible to move all the Google API implementation into an external web-service and just call this from my CMS? That way, I would not have to upgrade the CMS's old references. The only problem that I've run into with this is that I have no idea how to use OAuth2 to allow the CMS user to use his own Google account since all this is now done in the web-service, and the authentication page from google will not open in the user's browser.
I don't think a web service will work. The user needs to be prompted for authentication with the web browser. You cant really do that from a web service and return the proper authentication.
The Google .net client lib uses the newest DLLs you may want to look into upgrading yours.
I just wanted to know
It is simple to upload videos to youtube in c# but i want to do that without using their API. I am going to create a webpart for office365, so i can't use any external dlls. Only the .NET framework's assembly i can use.
Incase you want to upload to youtube you should use their apis, otherwise there is no way you can upload on to youtube, incase your problem is install APIs on office365 cloud, then you can look for Webservices to upload to Youtube, in web services case you have no dlls to register on the cloud.
No not simple, you have to create something that does what their API does. You do not have to build all functionality, only what you need. But still; not easy.