質問
私たちの利用ACSサンプル4から http://claimsid.codeplex.com/ としてのテンプレート当社のADFSます。して問題のないパッシブへの要求ADFS認証サービスのサンプルを連プロバイダはカスタムSTSのサンプル作品。
今では希望のカスタム連盟のプロバイダ(Adatum FPのサンプル)を自らのADFS.
当社の設定は次のように隠れた名前空間)
- ServiceClient:コンソール幅広く検討、通話サービス
- サービス:WCF Webservice、単一の方法文字列で返します。このとしてはデフォルト [Ordertracking.サービスのサンプル]
- サービス認証:当社ではカスタムデプロバイダです。これはデフォルトとして[Litware.SimulatedIssuerサンプル]
- ADFS:当社連盟プロバイダ[FederationProvider.Adatumに 例】
ServiceClientしたい通話サービスから構成を知り尽くしでにトークンからIPアドレス(サービス認証).トークンを渡されADFS、検証、トークン 送信の新しいトークンを返ServiceClient.顧客の新規パスのFPのトークンのサービスのサービス(依拠当事者にADFS)証トークンに対しADFSを行うサービスの方法。
の問題:
置き換え、STSの例ADFSているように統合しました。しかし、トークンからのIPバが正しくありまた、走行に問題を渡す場合は、IPのトークンADFS.そうするには、こちらをクリックして問題視聴者Uriは、その追加
https://'adfs fqdn'/adfs/サービス/信頼/13/IssuedTokenMixedSymmetricBasic256
お客様の例外 たMessageSecurityExceptionのクライアントこのInnerException InnerException {"ID3242:のセキュリティトークンが認証され又は認定してもらいました。"}
[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>
今までに聴衆のuri当社のIPいます。config:
<audienceUris mode="Always">
<add value="https://<adfs fqdn>/adfs/services/Trust/13/IssuedTokenMixedSymmetricBasic256" />
</audienceUris>
必要に応じて郵便追加設定ファイル、画面のADFSを設定します。
解決
こントがその解決の問題です。設定を行うのではなく、この接続のコードです。私は考えるのでしょうがエラーのどこかには、クライアントの設定をします。
アドバイスをもうこのコードです。XMLの設定は困難なものにするのに用いられております。
見つけたサンプルコードleastprivilege.com
private static SecurityToken GetIdPToken()
{
var factory = new WSTrustChannelFactory(
new UserNameWSTrustBinding(SecurityMode.TransportWithMessageCredential),
"https://systemidp.dk/Issuer.svc");
factory.TrustVersion = TrustVersion.WSTrust13;
factory.Credentials.UserName.UserName = "LITWARE\\rick";
factory.Credentials.UserName.Password = "thisPasswordIsNotChecked";
var rst = new RequestSecurityToken
{
RequestType = WSTrust13Constants.RequestTypes.Issue,
AppliesTo = new EndpointAddress("https://adfsfqdn/adfs/services/trust"),
KeyType = WSTrust13Constants.KeyTypes.Symmetric,
ReplyTo = "https://adfsfqdn/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256/"
};
factory.ConfigureChannelFactory();
var channel = factory.CreateChannel();
return channel.Issue(rst);
}
private static SecurityToken GetRSTSToken(SecurityToken idpToken)
{
var binding = new IssuedTokenWSTrustBinding();
binding.SecurityMode = SecurityMode.TransportWithMessageCredential;
var factory = new WSTrustChannelFactory(
binding,
"https://adfsfqdn/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256/");
factory.TrustVersion = TrustVersion.WSTrust13;
factory.Credentials.SupportInteractive = false;
var rst = new RequestSecurityToken
{
RequestType = WSTrust13Constants.RequestTypes.Issue,
AppliesTo = new EndpointAddress("https://services.dk/WebService.svc"),
KeyType = WSTrust13Constants.KeyTypes.Symmetric
};
factory.ConfigureChannelFactory();
var channel = factory.CreateChannelWithIssuedToken(idpToken);
return channel.Issue(rst);
}
をピコのトークン
var ipdtoken = GetIdPToken();
var stsToken = GetRSTSToken(ipdtoken);
var binding = new WS2007FederationHttpBinding(WSFederationHttpSecurityMode.TransportWithMessageCredential);
binding.Security.Message.EstablishSecurityContext = false;
var factory = new ChannelFactory<IWebService>(binding, "https://services.dk/WebService.svc");
factory.ConfigureChannelFactory();
factory.Credentials.SupportInteractive = false;
var serviceChannel = factory.CreateChannelWithIssuedToken(stsToken);
var s = serviceChannel.GetUserInformation();
他のヒント
のaudienceUri設定IPに見えます。と思いADFSは、それらをID3242ます。きよって実行されていることを確認IPが正しく設定され下請求プロバイダの信託におADFSサーバー?
だIPの連盟のメタデータを手軽に、も再現でADFS.