我正在尝试RemoveProtection
在多租户 Web 应用程序中使用 Azure AD App。我无法弄清楚如何。我目前的设置是:
使用以下代码
IAuthDelegate
AuthenticationContext authContext = new AuthenticationContext(authority, tokenCache); AuthenticationResult result; var clientCred = new ClientCredential(appInfo.ApplicationId, clientSecret); result = authContext.AcquireTokenAsync(resource, clientCred).Result; return result.AccessToken;`
主控制器中的代码
string name = User.Identity.Name; // Set path to bins folder. var path = Path.Combine( Directory.GetParent(Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath)).FullName, Environment.Is64BitProcess ? "bin\\x64" : "bin\\x86"); MIP.Initialize(MipComponent.File, path); ApplicationInfo appInfo = new ApplicationInfo() { ApplicationId = clientId, ApplicationName = appName, ApplicationVersion = appVersion }; AuthDelegateImplementation authDelegate = new AuthDelegateImplementation(appInfo); var profileSettings = new FileProfileSettings(mipPath, false, authDelegate, new ConsentDelegateImplementation(), appInfo, LogLevel.Trace); var fileProfile = Task.Run(async () => await MIP.LoadFileProfileAsync(profileSettings)).Result; var engineSettings = new FileEngineSettings(name, "", "en-US"); engineSettings.Identity = new Identity(name); var fileEngine = Task.Run(async () => await fileProfile.AddEngineAsync(engineSettings)).Result;
我的问题是如何使用它从 SharePoint 中的文档中删除 AIP?此外,是否有任何 REST API 用于此?