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


Post New Web Links

How to use basic authentication with WCF and IIS 6: Basic vs Windows credentials

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :WCF
 

Hi,

I would like to get basic authentication working with a WCF service running on IIS 6 and a WCF proxy (basicHttpBinding). The problem is that I'm totally lost in all these different configuration settings you can do in WCF and IIS 6. I would be glad if you could shed some light on this matter.

First of all, I have understood that the client credentials must be sent in the following way in WCF proxy code:

proxy.ClientCredentials.UserName.UserName = MyUserName;

proxy.ClientCredentials.UserName.Password = MyPassword;

But then comes the hardest part. How do I have to configure my WCF proxy and service along with IIS 6 for basic authentication?

After a lot of googling I found out that there are at least three variations on how you can configure basic authentication in WCF and here are my conclusions, please correct if I'm wrong:

1. Sending a user name and password as plain text without SSL to a web server:

<security mode="TransportCredentialOnly<


View Complete Post


More Related Resource Links

all basic windows controls,wpf controls,silverlight application

  
here you will find all the information from basic.

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.


MOSS Site with Basic Authentication and variations does not work on one node

  
Hi, We have one MOSS Farm with two nodes, on this we have several sites. For one specific site we have Basic Authentication and variations enabled in it, on one node site works fine. When we browse it pops-up for credentials and once credentials are provided it works fine and properly redirect to source variation home page. But on the other node when we browse the site it pops-up asking for credentials then after providing correct credentials it again asks for credentials twice and then it throws the following error : Access denied.   You do not have permission to perform this action or access this resource. And if we directly put the source site homepage url it throws following error: 401 UNAUTHORIZED We have checked the Alternate Access Mappings for the site and it is perfectly fine, if i enable windows authentication on the defected node the site works fine. This issue is just like pain in the neck still no resolution, please help us to resolve this issue. Regards, Jasjeet Singh

Basic Authentication => http://MainSiteUsername@MainSitePassword@sitename.com

  
Hi,We have an Main asp.net site and Help site which is a plain html protected by 'Basic Authentication'.The requirement is once you already login on the Main asp.net site,  there is a link "Help" which is calling http://MainSiteUsername@MainSitePassword@companyhelp.com this was working well till this KB834489 came in.Can you help us solve this issue? Same issue with this one:http://www.bigresource.com/Tracker/Track-asp-D5uQcKze/Hope someone could help me on this.br,Chris

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

Windows 7 (64x), Visual Basic Xpress V10, Sql Server Xpress V8R2 -Deployment results in Attempt to a

  
Hi all, I'm at my wits trying to figure this out.  It's a new 64x computer running Windows 7.  I've installed Sql Server Express V8 R2. The connection string is user instance = true.  And the database is located in a directory off the main directory to which the connection string points to. The error I get when starting up my VB Express 10 app is "An attempt to attach an auto-named database for file ‘C:\datadirectory\data.mdf’ failed. A database with the same name exists, or specified file cannot be opened, or it is located in UNC share. I've attached the database using sql server manager v10, and can see the data. Googling his error, there seems to be a lot of web-aps seeing this as well. I did have a problem after I installed sql server version 8 r2, just trying to create a database.  That was resolved by going through the IIS -configuration. If I can provide any other information, please let me know.  Cheers        

Windows 7 (64x), Visual Basic Xpress V10, Sql Server Xpress V8R2 -Deployment results in Attempt to a

  
Hi all, I'm at my wits trying to figure this out.  It's a new 64x computer running Windows 7.  I've installed Sql Server Express V8 R2. The connection string is user instance = true.  And the database is located in a directory off the main directory to which the connection string points to. The error I get when starting up my VB Express 10 app is "An attempt to attach an auto-named database for file ‘C:\datadirectory\data.mdf’ failed. A database with the same name exists, or specified file cannot be opened, or it is located in UNC share. I've attached the database using sql server manager v10, and can see the data. Googling his error, there seems to be a lot of web-aps seeing this as well. I did have a problem after I installed sql server version 8 r2, just trying to create a database.  That was resolved by going through the IIS -configuration. If I can provide any other information, please let me know.  Cheers        

Passing Credentials to IIS "Integrated Windows authentication" Protected Directory

  
Hello All,I have set up a directory on my IIS web server that is protected by "Integrated Windows authentication".  I want visitors to be required to enter a name and password to view files in the protected directory except if they are following a link to files in the protected directory from a certain page on my website.I am doing this to try to get better protection from search engine spidering than is provided by using a robots.text file. I am using ASP.NET 3.5 with VB.  I am wondering if there is a way to pass the log on credentials to the IIS server via a link, or if there is a way to fill in the name and password for the login screen automatically, or something else that would work.  It is OK if the login name and password are visible to the visitors.Any suggestions on how to do this would be appreciated or if there is a better way to accomplish what I am trying to do, I would like to know.Thanks 

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

Windows form application, Visual basic 9

  
please give me vb 9 ( visual studio 2008 ) language example, to create shortcut on the desktop, from file notepad.exe which stored in c:\windows\notepad.exe

Enabling Windows Authentication to SQL Server using Application Pool Credentials

  
I have created a WCF Service (VS2008), an application pool account which has the access to the SQL Server(in remote machine). Configured the App Pool account to the Virtual Directory in IIS (Version 6.0). Once I browse through the SVC file, I can see the WSDL file. I have the "Windows Authentication" and the 'Anonymous authentication" Checked in the Properties for the Virtual Directory. But when I access service through Client, I get "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.". Binding that is being used is HTTPBinding. I have set the Identity Impersonate to True as well. Bottom line is - I need to use the App Pool account to connect to the SQL Server. Could some one please help me in this?  

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!

Supply specific credentials for Windows Authentication

  

I started a standard WCF Service Application project to create a set of web services and deployed the application on a remote Windows 7 PC on the Internet.  I need to control access and want to make use of Windows authentication.  I have created a local machine account on that PC.

I then started a client project to consume the web services.  What I want is something like:

 ServiceReference1.ServiceClient ws = new ServiceReference1.ServiceClient();

 ws.Endpoint.Address = new System.ServiceModel.EndpointAddress("http://xxxx.dyndns-ip.com/myWebService/Service1.svc");

 ws.ClientCredentials.Windows.ClientCredential.UserName = WebConfigurationManager.AppSettings["username"];

 ws.ClientCredentials.Windows.ClientCredential.Password = WebConfigurationManager.AppSettings["password"];

 TimeNow = ws.GetTime().ToString();



I searched and tried all sorts of permutations of binding types, security modes, etc, but still am not sure what and how I should be doing.

Can someone show what I should have on the web.config on the web service application, and the web.config on the client appli

Basic authentication for Web service

  

Hi everybody,

 

i call my project web service, previously there was no pre-authetication. Now i didn't work web service. My code is as follows:

 

 //Cache'lenecek olan güvenlik dosyasi  
         CredentialCache credentialCache = new CredentialCache();  
   
         //Güvenlik dosyasinin olusturulmasi  
         NetworkCredential credentials = new NetworkCredential("username", "password");  
   
         //Güvenlik dosyasinin cachelenmesi  
         credentialCache.Add(new Uri("url"), "Basic", credentials);  
   
         //Web servisin classindan türetilmis ws objesi  
        


            spectrawsdl sp = new spectrawsdl();
            sp.Credentials = credentialCache;
            sp.UseDefaultCredentials = false;
            mainResponseType mrp= sp.addIncident("Test", "test", "test", "test");


What should I do?

 

 


Merge Replication: Web Sync error 28011 with Basic Authentication on WinCE 6.0

  

Hi,

I configured merge replication using SQL Server 2005 SP3 running on Windows Server 2008 R2 x64 with IIS 7.

My client is a .NET Compact 3.5 (RTM) application running on an embedded controller (Beckhoff CX1000) with Windows CE 6.0 installed. I am using SQL Compact 3.5 SP1 on the client. The preconfigured Win CE only had .NET Compact 2.0 installed, so I installed version 3.5 on the CompactFlash card attached to the controller.

Syncing over HTTP works perfecly using anonymous authentication.

I then executed the Web Sync Config Wizard and configured Basic Authentication without SSL. For authentication I use a local account even though my server is a member of our domain. The same account is used for access to the publication and distribution DBs (all located on the same server running IIS).

When I ran my client trying to sync, all I get is the 28011 error (Authentication failed).

The strange thing is that a test application on my desktop machine using .NET 3.5 (not Compact) can sync without problems. I even wrote a little test application for the embedded controller using the .NET HttpWebRequest object to connect to the server and I get the expected "Microsoft SQL Server Compact Server Agent" message.

I dug a little deeper into the issue and analyzed the HTTP packet getting sent to the server (using Wireshark). App

Cannot run Basic Web page from Visual Web Developer on IE8 on Windows 7 - won't accept connection e

  

I am trying to run the 'Basic Web Page' tutorial in internet explorer 8 on Windows 7.

I get an error message in IE8:

The remote device or resource won't accept the connection
Detected
Detected

The device or resource (localhost) is not set up to accept connections on port "51551".

 

I just upgraded from Vista to Windows 7. It did work on Vista so I think it must be related to security setting???

Cannot seem to get a hit on the web for help so appreciate any help.

 

 


Categories: 
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