API を使用して、Web アプリケーションとその ID クレーム エンコーディング タイプに関連付けられているすべてのクレーム プロバイダーを取得する必要があります。
例えば:
Windows 認証の ID クレームがユーザー名で、ユーザー名が文字列の場合、"i:0#.w" を取得する必要があります。
フォーム認証の ID クレームが電子メールで、プロバイダー名が "fba" の場合、"i:0!.f|fba|" を取得する必要があります。
以下のリンクは、Web アプリケーションに関連付けられているすべてのクレーム プロバイダーを取得する方法を示していますが、各プロバイダーの ID クレーム エンコーディング タイプを取得するにはどうすればよいでしょうか?
http://msdn.microsoft.com/en-us/library/gg650432(v=office.14).aspx#SP_WCP_Tip3
using (SPSite theSite = new SPSite("http://someContosoUrl"))
{
// Get the web application.
SPWebApplication wa = theSite.WebApplication;
// Get the zone for the site.
SPUrlZone theZone = theSite.Zone;
// Get the settings that are associated with the zone.
SPIisSettings theSettings = wa.GetIisSettingsWithFallback(theZone);
// Get the list of authentication providers that are associated with the zone.
foreach (SPAuthenticationProvider prov in
theSettings.ClaimsAuthenticationProviders)
{
// Need to get the identity claims encoding type using the SPAuthenticationProvider
}
}
Windows 認証の ID クレーム エンコーディング タイプは常に i.0#.w ですか、それとも ID クレームは常にユーザー名ですか?
ありがとうございます。それでは、お元気で、
カライ。