Skip to content

zhang-yangchen/mip-filesdk-dotnet-core

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

page_type languages products description urlFragment
sample
csharp
azure
This sample application demonstrates using the Microsoft Information Protection SDK .NET wrapper to label and read a label from a file.
mip-filesdk-dotnet-core

MIP SDK .NET Core Sample

This sample application will work on Ubuntu 18.04/20.04 or Windows. It's important to install the correct NuGet package, depending on which platform you're using.

Ubuntu 18.04 and 20.04

Install .NET Core

Install .NET Core SDK on Ubuntu

Install the MIP SDK dependencies on Linux.

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.

Install the NuGet Packages

This step is required only for new projects. Cloning this repo will auto-restore dependencies.

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.

dotnet add package Microsoft.InformationProtection.File.Ubuntu1804

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

dotnet add package Microsoft.InformationProtection.File.Ubuntu2004

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

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, tenantId, and redirect URI. 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-core/bin/Debug/. Run the app by executing ./mipsdk.exe or ./mipsdk

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%