问题
I have to implement "Windows Authentication" on a service hosted on Server.
I am using "ws2007FederationHttpBinding".
I am using "ws2007FederationHttpBinding" binding since I am receiving token from my ADFS server.
Below are my server configuration:
web.config
<authentication mode="Windows" />
<ws2007FederationHttpBinding>
<binding name="SamlTokenCustomStsBindingConfig">
<security mode="Message">
<message establishSecurityContext="false">
</message>
</security>
</binding>
</ws2007FederationHttpBinding>
<service name="XXX.Server" behaviorConfiguration="ClaimsAwareServiceBehavior">
<endpoint address="http://serverurl/ServerServices.svc" binding="ws2007FederationHttpBinding"
contract="ServerInterfaces.IServer" bindingConfiguration="SamlTokenCustomStsBindingConfig" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<behavior name="ClaimsAwareServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
Below is my IIS configuration:
Inspite of all the configuration I am unable to access my service. can anyone notify where I am making mistake or have I missed any configuration.
I am receiving below error when I am trying to access my service.
As per error we don't have "Transport" or "TransportCredentialOnly" in "ws2007FederationHttpBinding".
So I am unable to move further.
回答1:
You should comment this below line of code to avoid that mentioned error in your question:
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
but for implementing ADFS for WCF service needs several preconditions that can't be posted as answer but just for Windows
authenticate mode this is easier to use basicHttpBinding
by little steps.
so for ADFS implementation please take a look at:
1- ADFS in Identity Solutions - Using Active Directory Federation Services 2.0 in Identity Solutions.
2- Federated Security: How to setup and call a WCF service secured by ADFS 2.0
3- ADFS to secure WCF and Workflow Services hosted in Windows Server AppFabric.
来源:https://stackoverflow.com/questions/53476104/wcf-server-configuration-for-ws2007federationhttpbinding-and-windows-authenticat