You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用MIP SDK移除敏感度标签:一个成功一个失败

使用Microsoft Information Protection (MIP) SDK移除文件敏感度标签时的问题

已使用同一令牌在同一租户内成功创建两个敏感度标签,现在尝试用同一令牌移除这两个标签:

  • Label A 可成功移除
  • Label B 无法移除,操作时抛出错误

移除Label B时收到以下错误:

System.AggregateException: One or more errors occurred. (The service didn't accept the 
auth token. Challenge:['Bearer resource="https://aadrm.com", realm="", 
authorization="https://login.windows.net/common/oauth2/authorize"']
HttpRequest.Id=545b6654-31a7-4016-8d49-875e6678aab8,
CorrelationId=b373b0c3-1495-4461-84f8-5f34404299f0,
CorrelationId.Description=ProtectionEngine,
CorrelationId=7d063033-43c3-4971-900c-2ac3eefe29be,
CorrelationId.Description=FileEngine)

处理Label B时,执行以下代码中设置fileHandler的步骤出现错误:

fileEngine = MIPHelper.GetFileEngine();
fileHandler = fileEngine.CreateFileHandlerAsync(fileFullPath, fileFullPath, true).Result;

GetFileEngine方法的实现代码:

public static IFileEngine GetFileEngine()
{
    MIP.Initialize(MipComponent.File);

    ApplicationInfo appInfo = new ApplicationInfo()
    {
        ApplicationId = "AppId",
        ApplicationName = "MIPTest",
        ApplicationVersion = "1.0.0"
    };

    AuthDelegateImplementation authDelegate = new AuthDelegateImplementation(appInfo);

    MipConfiguration mipConfiguration = new MipConfiguration(
        appInfo, "mip_data", Microsoft.InformationProtection.LogLevel.Trace, false
    );
    mipConfiguration.LoggerConfigurationOverride = new LoggerConfiguration(10, 40, false);
    var mipContext = MIP.CreateMipContext(mipConfiguration);

    var profileSettings = new FileProfileSettings(
        mipContext, CacheStorageType.OnDiskEncrypted, new ConsentDelegateImplementation()
    );

    profile = Task.Run(async () => await MIP.LoadFileProfileAsync(profileSettings)).Result;

    var engineSettings = new FileEngineSettings(userName, authDelegate, "", "ko-kr");
    engineSettings.Identity = new Identity(userName);

    engine = Task.Run(async () => await profile.AddEngineAsync(engineSettings)).Result;

    return engine;
}

内容的提问来源于stack exchange,提问作者손동진

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 18:34:50