Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I want the client (which is a asp.net site) calls a wcf. Both are hosted in IIS7 in my laptop. For WCF i have enabled Basic authenticatin in IIS7 and disbaled all other things. For the client i have enabled basic authentication and disabled all other options in authentication.</p> <p>The problem is that with these configs below the client is not getting any data back from the wcf.</p> <p>If i in the browser navigate to the service by providing the url to the service then i have to enter username/passsword in the form that pops up.</p> <p>What i wan to do is to secure my wcf by username and password so that any one who wants to call my wcf have to provide username/pass and my wcf code check wether that exist (for instance in AD) and authenticates accordingly.</p> <p>my Client(simple ASP.net web site calling a WCF) web.config:</p> <pre><code>&lt;configuration&gt; &lt;appSettings&gt; &lt;add key="userName" value="Administrator"/&gt; &lt;add key="password" value="pass"/&gt; &lt;!--&lt;add key="url" value="http://localhost:57895/ListData.svc"/&gt;--&gt; &lt;!--http://localhost/WCF/--&gt; &lt;add key="url" value="http://localhost:8082/ListData.svc"/&gt; &lt;/appSettings&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0" /&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;directoryBrowse enabled="true"/&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>My WCF service web.config:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;appSettings&gt; &lt;add key="Logging" value="true"/&gt; &lt;/appSettings&gt; &lt;connectionStrings/&gt; &lt;system.web&gt; &lt;authentication mode="Windows"&gt;&lt;/authentication&gt; &lt;compilation debug="true" /&gt; &lt;pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/&gt; &lt;/system.web&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="httpBinding"&gt; &lt;security mode="TransportCredentialOnly"&gt; &lt;transport clientCredentialType="Basic" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;!--&lt;webHttpBinding&gt; &lt;binding name="webHttpTransportSecurity"&gt; &lt;security mode="Transport"&gt; &lt;transport clientCredentialType="Basic"/&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/webHttpBinding&gt;--&gt; &lt;/bindings&gt; &lt;services&gt; &lt;service behaviorConfiguration="SecureRESTSvcTestBehavior" name="Hdir.ListData"&gt; &lt;!--&lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:57895/ListData/"/&gt; &lt;/baseAddresses&gt; &lt;/host&gt;--&gt; &lt;!--webHttpBinding allows exposing service methods in a RESTful manner--&gt; &lt;endpoint address="" binding="basicHttpBinding" bindingConfiguration="httpBinding" behaviorConfiguration="webHttpBehavior" contract="Hdir.IListData"/&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;!--&lt;behavior name=" "&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt; &lt;/behavior&gt;--&gt; &lt;behavior name="SecureRESTSvcTestBehavior"&gt; &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --&gt; &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt; &lt;serviceAuthorization serviceAuthorizationManagerType="Hdir.CustomAuthorizationManager, Hdir"/&gt; &lt;!--&lt;serviceCredentials&gt; &lt;userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Hdir.Hp.Data.CustomUserNameValidator, Hdir.Hp.Data" /&gt; &lt;/serviceCredentials&gt;--&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="webHttpBehavior"&gt; &lt;!--&lt;webHttp/&gt;--&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; &lt;system.webServer&gt; &lt;directoryBrowse enabled="true"/&gt; &lt;httpProtocol&gt; &lt;customHeaders&gt; &lt;add name="Access-Control-Allow-Origin" value="*"/&gt; &lt;add name="Access-Control-Allow-Headers" value="x-requested-with"/&gt; &lt;add name="Access-Control-Request-Method" value="GET"/&gt; &lt;/customHeaders&gt; &lt;/httpProtocol&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload