在多租户Web应用中删除保护

时间:2019-07-19 10:00:22

标签: sdk azure-information-protection microsoft-information-protection

我正在尝试在多租户Web应用程序中使用Azure AD App使用RemoveProtection。我不知道如何。我当前的设置是:

  1. 注册具有以下权限的Azure AD应用 enter image description here

  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;
    

我的问题是为什么我们需要租户ID才能获得令牌?为什么common端点即使是多租户应用程序,并且我正在使用秘密使用client-credentials流,也无法使用?

0 个答案:

没有答案