Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

OneNoteDev/OneNoteApiSampleAspNetCore

Repository files navigation

OneNote service API ASP.NET core sample

Created by Microsoft Corporation, 2017. Provided As-is without warranty. Trademarks mentioned here are the property of their owners.

DEMO: http://onenoteapisamplenetcore.azurewebsites.net/

Intro

  • This is a small sample that shows how to use the OneNote API from an ASP.NET server.
  • It is configured to work for OneDrive only, but swapping AppIds/Auth urls would make it work with O365

Prerequisites

Tools and Libraries you will need to download, install, and configure for your development environment

Using the sample

After you've set up your development tools, and installed the prerequisites listed above,...

  1. Download the repository as a ZIP file to your local computer, and extract the files. Or, clone the repository into a local copy of Git.
  2. Open the project (.sln file) in Visual Studio.
  3. It is highly recommended that you get your own client ID, secret and redirect uri and copy it into Config.cs You can get your own appid, app secret and redirect uri here
  4. Make a change to your machine (In windows, this is hosts file change) so the domain "onenoteapisamplenetcore.azurewebsites.net" (or the domain for the redirect URI you've chosen for your app) resolves to localhost or "127.0.0.1". Otherwise, authentication won't work.
  5. Make sure you have selected the "OneNoteApiSample" configuration when launching the app locally. See screenshot.
  6. Build and run the application (F5)

Content

You can find additional documentation at the links below.

Note

As a sample, and for simplicity, this sample does not follow best practices for an application in Production. If you intent to ship this code, we recommend doing the following:

  • Never check in app secrets to your repository

  • Require HTTPS throughout your site

  • Don't store unencrypted refresh tokens in cookies

  • NuGet packages used in the sample. These are handled using the package manager, as described in the setup instructions. These should update automatically at build time; if not, make sure your NuGet package manager is up-to-date. You can learn more about the packages we used at the links below.

Version Info

Date Change
January 2017 Initial public release for this code sample.

Learning More

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments. \ No newline at end of file

About

OneNote API sample in ASP.NET core

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published