Giter VIP home page Giter VIP logo

mipsdk-file-dotnet's Introduction

page_type languages products description urlFragment
sample
csharp
m365
office-365
This sample application demonstrates using the Microsoft Information Protection SDK .NET wrapper to label and read a label from a file.
MipSDK-File-Dotnet

MIP SDK .NET 6.0 Sample

This Microsoft Information Protection File SDK sample can run on Windows, or Ubuntu 18.04/20.04. It demonstrates initializing the MIP SDK and labeling a file.

.NET 6.0 or later is required to run the sample: https://dotnet.microsoft.com/en-us/download/dotnet/6.0

Ubuntu

If you're running on Ubuntu, follow these steps to install the necessary dependencies.

Install the MIP SDK dependencies on Ubuntu

sudo apt-get install scons libgsf-1-dev libssl-dev libsecret-1-dev freeglut3-dev libcpprest-dev libcurl3-dev uuid-dev

Install the Microsoft Authentication Library dependency

MSAL on Ubuntu, when authentication in a public client application, will use a browser to perform authentication. This requires the xdg-utils package. This is included only for demonstration and not required for other auth patterns.

sudo apt-get install xdg-utils

Windows

Running on Windows requires that the Visual C++ Runtime redistributable is installed.

Required NuGet Packages

In the project directory, add the required packages by running:

dotnet add package Microsoft.Extensions.Configuration
dotnet add packageMicrosoft.Extensions.Configuration.FileExtensions
dotnet add package Microsoft.Extensions.Configuration.Json
dotnet add package Microsoft.Extensions.DependencyInjection
dotnet add package microsoft.identity.client

If running on Ubuntu 18.04, install the Ubuntu 18.04 package.

# Ubuntu 18.04
dotnet add package Microsoft.InformationProtection.File.Ubuntu1804

If running on Ubuntu 20.04, install the Ubuntu 20.04 package.

# Ubuntu 20.04
dotnet add package Microsoft.InformationProtection.File.Ubuntu2004

If running on Windows, install the base MIP SDK package.

# Windows Only
dotnet add package Microsoft.InformationProtection.File

Update appsettings.json

Register an application in Azure Active Directory. Once complete, populate the appsettings.json file with details from the application registration: clientId and tenantId. Change ida:IsMultiTenantApp depending upon the type of application you've registered.

Build the project and run

From the /src directory, run the following to build:

dotnet build --output ../bin/Debug

The application will output to mip-filesdk-dotnet/bin/Debug/net6.0. Run the app by executing ./mipsdk.exe or ./mipsdk

mipsdk-file-dotnet's People

Contributors

tommoser avatar microsoftopensource avatar microsoft-github-operations[bot] avatar zhang-yangchen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.