.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

FBA authentication of WCF service

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :C#
Hi I have a WCF service external to Sharepoint. Both use Forms Authentication from the same database. I'd like to design a Silverlight WebPart to be hosted in Sharepoint. I don't know how get the FBA username/password from Sharepoint so I can pass it to the WCF service. Is this possible?

View Complete Post

More Related Resource Links

Looking for a simple Service and Console Client REST sample implementing BASIC authentication


Does anyone know of a C# code sample demonstrating WCF REST services and console test client with OperationContracts (GET and POST) implementing mutiple paramaters using BASIC authentication? Also, perhaps, using Fiddler as a test client as well? I have searched high and low for something like this, but have not had any success.

authentication issues using exchange web service within sql CLR functions

Hi Hope this is the right forum for this question, we have a VB assembly we have written to perform simple email functions via calls to EWS. We use a high level user who has rights to impersonate the normal exchange users, and this usually works OK, but what we are seeing is that occasional email messages are being created in the wrong user's draft folders. We belive this is because the impersonating account information is getting overwritten within our code when multiple users access the functions at the same time Example call to the WS is... <Microsoft.SqlServer.Server.SqlProcedure()> _ Public Shared Sub InsertEmail( _ ByVal Impersonate As String, _ ByVal Subject As String, _ ByVal Body As String, _ ByVal ToAddress As String, _ ByVal CCAddress As String, _ ByVal BCCAddress As String, _ ByVal HTMLEmail As Boolean, _ <Out()> ByRef ItemID As String, _ <Out()> ByRef ChangeKey As String) 'ByVal CCAddress As String, _ 'ByVal BCCAdddress As String, _ Using esb As Helper = New Helper(Impersonate) ' Create the CreateItem request. Dim createEmailRequest As New ews.CreateItemType() ' Specifiy how the e-mail will be handled. createEmailRequest.MessageDisposition = ews.MessageDispositionType.SaveOnly createEmailRequest.MessageDispositionSpecified

Unable to call an asmx web service using windows authentication from a Service workflow

Hello, I need to use an existing asmx service from inside my service workflow and I am unable to call it. This asmx service is hosted in a web application with iis set to windows authentication, anonymous is not allowed. I need to send the authentication, only way seems too be using transport for basicHttpBindings. Every time I try to call the service I get an error saying that there is nothing listening to the url of the service generated automatically by VS when I added the Service Reference ? my web config <configuration> <configSections> </configSections> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <protocolMapping> <add scheme="http" binding="wsHttpBinding" bindingConfiguration="WindowsCreds" /> </protocolMapping> <bindings> <basicHttpBinding> <binding name="UtilitiesSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

Security settings for this service require Windows Authentication but it is not enabled for the IIS

Hosting service in IIS 5.1   Config is set to transport layer security. SSL is installed and configured on the virtual folder and BasicHTTP bidings are being used for connection. Authentication in web.config is set to Windows Authorization in web.config is set to Deny Users="?" and Allow Users="*"   When trying to connect to the service using IE, it throws exception that "Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service. "   Can some one tell me what is missing?   Do I have to set anything in Web.Config?   I need to achieve following using Basic HTTP binding   Transport Layer security (SSL), Windows Domain Authentication, Use  user's Domain identity to impersonate the user in service   Please suggest the settings if any   Thanks

Sesame: Spatial OData on Maps, Service Operations, HTTP Basic Authentication

Sesame Data Browser has just been updated to offer the following features for OData feeds: MapsImproved Service operations (FunctionImport) supportHTTP Basic Authentication supportMicrosoft Dallas support Maps Sesame now automatically displays items on a map if spatial information is available in data.This works when latitude and longitude pairs are provided.Here is for example a map of drinking fountains in Vancouver:This comes from DrinkingFountains in http://vancouverdataservice.cloudapp.net/v1/vancouver, which provides latitude/longitude for each fountain. Here is another example, without latitude/longitude this time: This is a map of the customers from the Northwind database, which are located based on their country, postal code, city, and street address. Service operations (FunctionImport) Support for service operations (aka FunctionImports) has been improved. Until now, only functions without parameters were supported. It's now possible to use service operations that take input parameters. Let's take as an example the GetProductsByRating function from http://services.odata.org/OData/OData.svc.This function is attached to Products, as you can see below: A "rating" parameter is expected in order to open the function: After clicking Open, you'll get data as usual:HTTP Basic Authentication New authentication options have been added: HTTP Basic and Dallas (more

:Connection to the WCf service that has connection name http://mysite/SERVICE/authentication.svc?wsd

Hi, I have developed a custom WCF service which gave the following errors while adding my wcf services to sharepoint 2010 site. Error1:Connection to the WCf service that has connection name http://mysite/Service/Authenticate.svc?wsdl cannot be established. Error2:Connection to the WCf service that has connection name http://mysite/SERVICE/authentication.svc/mex cannot be established Please suggest me. Thanks in advance. Varma

Web service authentiation when mixed authentication methods are used

I am trying to pull data from the list.asmx web service from a console application. I am using clams based authentication, and whenever only integrated Windows Authentiation is checked everything works fine. Whenever I also check Enable Forms Based Authentication I start getting an Acccess is denied error when I try to connect to the service. I can login successfully using FBA so I don't think the problem is caused by the FBA configuration. Does anyone have any ideas to what might be causing this?

silverlight + WCF Service + Dynamic proxy(custom binding) + basic authentication on iis

hi all, I am having an issue with how to get windows identity in silverlight project. Below is my scenario: the silverlight application need to get data from server via WCF service, i used the way that built dynamic proxy at runtime and aslo used custombinding in this case. Now my application need to deploy on iis and chosen "basic authentication" as a authentication mode. Thus i have chosen authentication mode in WCF was " <security authenticationMode="UserNameOverTransport">". At the client side where kind of project is silverlight that i need have to dynamic proxy with custombinding. My question is: In basic authentication how can i get windows identity to set to chanelfactory.Credentials: _channelFactory = new ChannelFactory<TWebService>(this._binding, new EndpointAddress(_endpointAddress));            _channelFactory.Credentials.UserName = new UserNamePasswordClientCredential();            _channelFactory.Credentials.UserName.UserName = "username";            _channelFactory.Credentials.UserName.Password = "password"; actually, i do not want to use Windows a

WPF consuming WCF Service with Windows Authentication - Not Working

Hi I am developing a WPF application in .NET 4.0 which calls a WCF Service hosted on the server developed in .NET 4.0. I want to use windows authentication for this purpose and it seems that it is not working and keep on giving me following error. The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via I do not want to use https as this is an Intranet application. The WCF Service inturn calls SQL Server SPs via Entity Framwork 4.0. Following is the Web.Config for WCF Service. <?xml version="1.0"?> <configuration> <connectionStrings> <add name="MsdbEntities" connectionString="metadata=res://*/MsdbModel.csdl|res://*/MsdbModel.ssdl|res://*/MsdbModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=lvapxdev\lvw_uat_02;Initial Catalog=msdb;Integrated Security=SSPI;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> <appSettings> <add key="IndexLoaderInstallDirectory" value="D:\Longview\Index Loader\"/> </appSettings> <system.web> <compilation debug="true" targetFramework="4.0" /> <customErrors mode="Off"/> <authentication mode="Windows"></authentication> </syst

SQL Reporting Service, Cookies and Forms Authentication

Hi, I currently have a instance of SQL Reporting Services that uses custom Forms authentication. When I access the Report Manager through Internet Explorer the Report Manager redirects to my login page, I login and it heads back to the Report Manager and everything works as expected. The problem I'm having is when I use the web service it fails when I call ListItems( ... ). I first create an instance of the service, I then call LogonUser with a username and password, which executes fine, then I call the ListItems which throws an exception similar to: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<html>  <head>   <title>    SQL Server Reporting Services   </title><meta name="Generator" content="Microsoft SQL Server Reporting Services 10.50.1600.1" /> <meta name="HTTP Status" content="500" /> <meta name="ProductLocaleID" content="127" /> <meta name="CountryLocaleID" content="1033" /> <meta name="StackTrace" content="   at Microsoft.ReportingServices.

WCF Service using SSL and Certificate Authentication.

Hi All,     I have a WCF service and want to use Transport Security and Certificate for Client Authentication.   When I am tryting to connect to service , I am getting the following error:   The SSL settings for the service 'None' does not match those of the IIS 'Ssl, SslNegotiateCert, SslRequireCert'.     I have configured the IIS to use SSL. Given below is the  configuration section for WCF service at server end:   <system.serviceModel> <services> <service name="HelloWorld.Service1" behaviorConfiguration="ServiceBehavior" > <!-- Service Endpoints --> <endpoint address="https://localhost/SecureHelloWorld/Service.svc/ws" binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="HelloWorld.IService1"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address=https://localhost/SecureHelloWorld/Service.svc/mex binding="mexHttpsBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceCredentials> <serviceCertificate findValue="XXXXXXXXXXXXXX" x509FindType="FindByThumbprint" storeLocation="LocalMachine" storeName="My" /> <

how to store credentials with windows authentication in reporting service for subscription

when I try to set up a subscription, I get this error message: "Subscriptions cannot be created because the credentials used to run the report are not stored or if a linked report, the link is no longer valid" I use a datasource which use windows credentials to access a database which contains stored procedure with OpenRowset query to access cube data in analysis service on the same server.  I have to use windows credentials to access cube data in analysis service.  How can I store the credentails with windows credentials? I appreciate your help!

PassThrough authentication fails: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

I've tried it with every AuthenticationMode! But no one seems to work correctly in my case. I thought that PassThrough should work with a preset User ID and password. This would be enough for the moment, but even this doesn't work!! With WindowsCredentials I get the following error: The Property with name 'SsoApplicationId' is missing on the LobSystemInstance. SsoApplicationId I tried to set this with the SharePoint SSO but I've no such services. How can I set this just for the current WindowsCredentials (of the current Sharepoint user)? With RevertToSelf I get the following error: "An error occurred while retrieving data from MyLOBInstance. Administrators, see the server log for more information." The server log contained no useful information for me. With PassTrough I get the following error: "Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. [CLIENT: <local machine>]" Why are the lines <Property Name="RdbConnection User ID" Type="System.String">MyDomain\Administrator</Property><Property Name="RdbConnection Password" Type="System.String">mYpAssWoRd</Property> being ignored? Everything (MOSS, SQLServer,...) is on a single machine, so I don't need to activate Kerberos, do I? <LobSystemInstance Name="SEPInstance1207">   <Properties>    <Property Name="DatabaseAccessProvider" Type="Micros

Data Service Authentication

I have a simple auth need with my WCF Data Service but I'm not sure of the best way to tap into the plumbing.  Basically I'm using Forms Auth to protect my entire site.  Now, I wanted to protect my *.svc file as well but I need it to behave differently that *.aspx pages when the user is un-authenticated.  For *.aspx pages the behavior is perfect, the user is redirected with a 302 to the login page.  But, for the *.svc file, I'm calling that from an AJAX call in my javascript code.  I don't want a redirect to a login in page, my javascript code expects a 401 error (normal REST behavior).So, my thought is to remove my *.svc from form authentication control in web.config.  But what I don't know how to do is tap into the request pipeline of WCF Data Service, check their ASP.Net session to see if they're authenticated, and it not, don't proceed to have the normal Data Service engine execute the response but instead return a 401 error.In addition, I'd like to detect if the request is coming from my AJAX code.  I'm fine with interogating the Accept-Type header: if it's application/json, I know it's my browser code and I'll return 401.  If it's not application/json, then I'll assume it's someone testing the *.svc file from a browser and I can indeed redirect them to the login.aspx page.A

Sharepoint Claim Based Authentication Web Service issue


Hi all,

I have Configured sharepoint 2010 foundation to use claim based authentication with sqlmembership provider.

When i try to consume the webservice i get access denied error. The service i wish to consume is http://<server>:25757/_vti_bin/usergroup.asmx.

I tried to find out the issue i cannot consume the service as it redirects me to the login page. I also tried to pass the network credentials but same error. (Server was unable to process request. ---> Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

When i try to consume the same service of another web application (sharepoint 2010 foundation) it works. Only difference between the two web application is classic authentication with NTLM and other is CLAIM based authentication windows (with NTLM) / forms.


Best Regards,


Security settings for this service require Windows Authentication but it is not enabled for the IIS




We are getting the following error, when we call a WCF service from IE. The service is developed in MS.NET 3.5 and hosted in IIS 6.0, Windows Server 2003 SP2


Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service.


NOTE: The same is working GOOD in IIS 6.0, Windows XP SP2


IIS Setting


"Integrated Windows Authentication" is enabled in the "Directory Security"






<binding name

Setting up a Digest Authentication WCF service and consuming it


I have a WCF service that had been using NTLM authentication, but needed to recently switch it to digest authentication. The service is running on both an XP Professional machine, as well as a 2003 Server machine, both experiencing the same issues.


To set-up the digest authentication, I created the following in my web.config servicemodel section:



		<binding name="NtlmConnect" maxBufferSize="147483647" maxBufferPoolSize="147483647" 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend