ACSサンプル4( http://claimsid.codeplex.com/から)をADFSプロジェクトのテンプレートとして使用しようとしています。ADFS認証済みサービスへのパッシブリクエストには問題はありません。サンプルでは、フェデレーションプロバイダーはカスタムSTSであり、サンプルは正常に機能します。
ここで、カスタムフェデレーションプロバイダー(サンプルのAdatum FP)を独自のADFSに置き換えたいと思います。
現在の設定は次のとおりです(名前空間は非表示)
- ServiceClient:コンソールアプリケーション、サービスを呼び出します
- サービス:WCF Webサービス、文字列を返す単一のメソッド。これはデフォルトです[サンプルのOrdertracking.Services]
- Services.Authentication:カスタムIDプロバイダー。これはデフォルトです[サンプルのLitware.SimulatedIssuer]
- ADFS:フェデレーションプロバイダー[例ではFederationProvider.Adatum]
ServiceClientはServicesを呼び出したいと考えており、構成からIP(Services.Authentication)からトークンを取得する必要があることを認識しています。次に、トークンはADFSに渡され、ADFSはトークンを検証して、新しいトークンをServiceClientに送り返します。newクライアントはFPトークンをサービスに渡し、サービス(ADFSの依存側)はトークンをADFSに対して検証し、サービスメソッドを実行します。
問題:
例のSTSをADFSに置き換えると、統合が壊れているようです。IPからトークンを正しく取得しているようですが、IPトークンをADFSに渡すときに問題が発生しています。オーディエンスURIに問題があるようですが、追加しました
https://'adfs fqdn' / adfs / services / Trust / 13 / IssuedTokenMixedSymmetricBasic256
クライアント例外 このInnerExceptionInnerException{"ID3242:セキュリティトークンを認証または承認できませんでした。"}を使用して、クライアントでMessageSecurityExceptionを取得します。
[System.ServiceModel.FaultException]: {"ID3242: The security token could not be authenticated or authorized."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: null
Message: "ID3242: The security token could not be authenticated or authorized."
Source: null
StackTrace: null
TargetSite: null
ADFSデバッグログ
<TraceRecord xmlns="http://schemas.microsoft.com/2009/10/IdentityModel/TraceRecord" Severity="Error">
<Description>Handled exception.</Description>
<AppDomain>Microsoft.IdentityServer.ServiceHost.exe</AppDomain>
<Exception>
<ExceptionType>Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</ExceptionType>
<Message>ID1038: The AudienceRestrictionCondition was not valid because the specified Audience is not present in AudienceUris. Audience: 'https://<adfs fqdn>/adfs/services/Trust/13/IssuedTokenMixedSymmetricBasic256'</Message>
<StackTrace>
at Microsoft.IdentityModel.Tokens.SamlSecurityTokenRequirement.ValidateAudienceRestriction(IList`1 allowedAudienceUris, IList`1 tokenAudiences) at Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenHandler.ValidateConditions(Saml2Conditions conditions, Boolean enforceAudienceRestriction) at Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenHandler.ValidateToken(SecurityToken token) at Microsoft.IdentityServer.Service.Tokens.MSISSaml2TokenHandler.ValidateToken(SecurityToken token) at Microsoft.IdentityModel.Tokens.WrappedSaml2SecurityTokenAuthenticator.ValidateTokenCore(SecurityToken token) at System.IdentityModel.Selectors.SecurityTokenAuthenticator.ValidateToken(SecurityToken token) at Microsoft.IdentityModel.Tokens.WrappedSamlSecurityTokenAuthenticator.ValidateTokenCore(SecurityToken token) at System.IdentityModel.Selectors.SecurityTokenAuthenticator.ValidateToken(SecurityToken token) at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver, IList`1 allowedTokenAuthenticators, SecurityTokenAuthenticator&amp; usedTokenAuthenticator) at
....
</StackTrace>
</Exception>
</TraceRecord>
IPWeb.configにオーディエンスURIを追加しました。
<audienceUris mode="Always">
<add value="https://<adfs fqdn>/adfs/services/Trust/13/IssuedTokenMixedSymmetricBasic256" />
</audienceUris>
必要に応じて、追加の構成ファイルとADFS構成のスクリーンショットを投稿できます。