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

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

WCF Data Service as Forms Auth ASP Auth Source

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :ASP.Net


I was wondering if it is possible to use a WCF Dataservice as the MemberShipProvider for a forms auth application. I have written code for a provider (below), but I do not know what to do as far as a connection string, or any other web.config properties. Please Help!!! Here is the code for my provider, anytime it says Odbc that is because I based this off of the custom Odbc provider on the msdn site. The only ACTUAL references to any odbc connection are in the comments:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Collections.Specialized;
using System.Web.Security;
using System.Configuration.Provider;
using System.Configuration;
using System.Data.Odbc;
using System.Text;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Data;
using nGreekApplication.Web.nGreekService;

namespace nGreekApplication.Web.Services
    public class nGreekProvider: MembershipProvider


View Complete Post

More Related Resource Links

Reporting Service Model with db2 data source?

Sorry if this has been already asked.  I searched, but couldn't find it any previous posts. My question is can you have db2 as a datasource in Reporting Service Model?  Currently in the drop down I can only see SQL, which we have a few models over, and Oracle.  We are using SQL server 2008 r1. If not does Microsoft have any plans to add this in the future? Thanks for any help!

Differentiate between Windows Auth and Forms Auth users when authenticating against same AD with Sha

I am currently working on a SharePoint 2010 project where the environment is setup with a SharePoint web application using claims based authentication. The web app is created on port 8081 using Windows Authentication for auth, and extended to port 80 using Forms Based Authentication.

The forms authentication provider is setup to use the same active directory as the windows auth based site, using the following entries in the application's web.config (the entries are in the central administration and security token service web.config files as well):

        <membership defaultProvider="i">
        <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add name="FBA_AD_MP" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADFBAConnectionString" enableSearchMethods="true" attributeMapUsername="userPrincipalName" />

moss07 calling wcf service - caller not auth by service


I've got a moss2007 web part that is calling a wcf service. I can call the service fine outside of moss and it works fine. when i convert the user control into a web part and make the call I get:

System.ServiceModel.Security.SecurityNegotiationException: The caller was not authenticated by the service. ---> System.ServiceModel.FaultException: The request for security token could not be satisfied because authentication failed. at System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target) at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState) --- End of inner exception stack trace --- Server stack trace: at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout) at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout) at System.ServiceModel.Security.SecurityUtils.OpenTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout) at System.ServiceModel.Security.SymmetricSecurityP

ASP 4.0 and Custom SQL Server DB for Forms Auth


Hi, I have done some research and tried to find answers on how to integrate forms authentication with ASP.NET but all I can find is for 2.0. I don't mean to sound ignorant or annoying about it, but does anyone have a quick link to somewhere where I could find out how to integrate a custom SQL Server DB (with username, password, id, etc columns for user) with ASP.NET 4.0?

My application is actually a Silverlight Business Application where I am trying to log in/register users in a separate Database in a SQL Server 2008 engine.

If you don't have a link, but instead suggestions, anything would be much appreciated! Thanks,


ASP.NET Forms Auth - exclude "/" root from being authenticated


Hi All,

 We have a weird issue found during setting up a new Windows 2003 Server with IIS6.0 & ASP.NET 2.0, our site is built using ASP.NET forms authentication with general authorization to deny access to all users & allow explicitly to static, home pages etc, -- web.config setting for forms auth looking as below:

         <authentication mode="Forms">
            <forms name="appNameAuth" path="/" loginUrl="~/Pages/Users/Login.aspx" protection="All" timeout="60" defaultUrl="~/Pages/Inner.aspx">
            <deny users="?"/>

Issue is this:

If we access the site as http://localhost/default.aspx works fine & can view the home page of our website, but if we access using http://localhost/ - expect to view the default.aspx (as it's set as default document), but for some reason ASP.NET Forms Authentication thinks "/"

iis 7 forms auth


I'm using iis7 with forms authentication. I attempt to login and sometimes it works and other times it does not. Any idea what is causing this to not properly?

<forms name="secureCookie" loginUrl="login.aspx"

/secure is the private folder. If I attempt to log in and it bounces back all I have to do is type in the path to the secure folder and it acknowledges me just fine. I don't understand why it is so up and down.

forms auth with AD


I've got one Web Application with multiple authentication providers. Problem, the forms auth site isn't seeing the AD user: testuser. It is looking at someother account. Why?

Two Authentication Methods
1. Windows - uses domain
2. Forms - uses domain - see web.config below


User Info per auth sites
1. mydomain\testuser --- windows auth site -- see my AD user
2. membershipadprovider:testuser --- forms auth site -- sees some other user -- not sure why

Web.Config for Forms Auth Site:
    <add name="ADConnectionString" connectionString="LDAP://mydomain.com/DC=mydomain,DC=com" />

  <clear />
  <!--<add key="MembershipADProvider" value="%" />-->

<authentication mode="Forms">
  <forms loginUrl="/_layouts/login.aspx" domain="" name=".ADAuthCookie" timeout="20" protection="All" />

<membership defaultProvider="MembershipADProvider">
  <add name="Me

How can you debug a report data source that is an XML web service?


I have a report that is using an XML web service as it's datasource.  I would like to know what parameter 

values the report is passing to the web service. 

I tried the following debugging process but it did not work.

1.  Set the Reporting Services Project as the Starting Project.

2.  Set the report as the startitem in the project's startitem property.

3.  Set a breakpoint in the web service.

4.  I started the debugging which opened the report.  I put in a parameter value and ran the report.

But the debugger did not stop at the breakpoint.  What am I doing wrong?

How can I know what parameter values are being passed to the web service?





XML web service showing error in Data Source Library when I clicked on "Show Data".


Hi ,

I am working on share point 2007.
I have added a XML Web service in Data source in Share Point designer 2007. This web service is custom web service which get data from 3 different type of list and creates XML and return that xml.

I have installed this web service as instructed in msdn. I checked it is working properly.
First time when I create a data source from XML web service in Share Point Designer 2007, It shows all records when I clicked on “Show Data ”. But after a few minutes it shows en error” The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator. ”.

Gaurav Goyal

WCF web service as a data source


Hello everyone,

I need help with correct syntax usage. I am using SSRS to go against WCF web service as a data source. Inside of the WCF object there is a collection of items that I need to use as Search Criteria for the query.


My question is:

What is the correct XML syntax to create this collection of items within the query? I've used WCFStorm to help generate most of the XML syntax. Unfortunately, the collection syntax does not work.


Here is my query (I have emboldened the segment of the query which my question is directed towards):


     <Method Namespace="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09" Name="MetadataGetRequest">


     <Parameter Name="ResultOptions" Type="XML">





 <Parameter Name="SearchCriteria" Type="XML">


<MemberTypes attr0="MemberTypeArray">




Forms Auth ticket not sliding


I have a project the uses Forms authentication and Session. Session Timeout is set to 10 minutes, forms timeout is set to 8 minutes
On one page in the project, I don’t want the session or forms ticket to exipre at all. To accomplish this, I have a small hidden iframe (containing keepalive.aspx) at the bottom of the page at contains the tag

meta id="MetaRefresh" http-equiv

WCF Data Service to JSON example? v4


I would like to take WCF Data Service and produce JSON output to consume on various mobile apps.

Can anyone give me a how-to on the JSON part?  I.e., what is different than normal XML outut?



Toolbox: Data Snapshots, Subversion, Source Code Organization and More


If you want to save, organize, and annotate snapshots of your database data, find an easy way to install and configure Subversion, and automate the organization of your source code, then you'll want to read more about these latest tools.

Scott Mitchell

MSDN Magazine August 2009

Data Points: Service-Driven Apps With Silverlight 2 And WCF


Here John Papa demonstrates how to build a Silverlight 2 user interface that communicates through WCF to interact with business entities and a database.

John Papa

MSDN Magazine September 2008

Data Points: Data Source Controls in ASP.NET 2.0


ASP. NET 2. 0 introduces a series of new tools that improve data access including several data source and data bound controls. The new assortment of data source controls can eliminate a ton of repetitive code that was required in ASP.

John Papa

MSDN Magazine January 2005

Using Session to pass data between forms


In my app, I am displaying an Rss Feed, I have a button that takes the user to another form where they can select a them.  Upon selecting the theme, they are taken back to the original form. 

If the user has selected which theme they want to view then they click on the button to change theme, I need to pass the information about what rss feed they were viewing through session so that once they select the theme they want they are redirected back to the main page and the rss feed they were viewing should still be displayed.

Since I've already bound the data to the xmlDataSource and DataList I am trying the following:

Session.Add("CurrentRssFeed", XmlDataSource1.DataFile);

Session.Add("CurrentDataList", DataList1);

I'm not sure I am passing the data over correctly and I'm not sure how to specify it in the page_preinit.

Any ideas???

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