1

我正在尝试RemoveProtection在多租户 Web 应用程序中使用 Azure AD App。我无法弄清楚如何。我目前的设置是:

  1. 注册了具有以下权限的 Azure AD 应用 在此处输入图像描述

  2. 使用以下代码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;`
    
  3. 主控制器中的代码

      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 用于此?

4

0 回答 0