Secure IIS Hosted WCF Service For Access Via IE Hosted WinForms User Control

Feb 2, 2011

I have an ASP.Net site using Forms authentication. One of the aspx pages loads a WinForms user control hosted in IE. That control must connect with a WCF service located in the same ASP.Net web site.How can I make the WCF service secure? Currently I have set the WCF service to use AspNetCompatibilityRequirements mode but the user control hosted in IE can't connect to the WCF service as it isn't logged in.

View 1 Replies

Similar Messages:

WCF / ASMX :: How To Secure Web Service Hosted In IIS

Oct 16, 2010

I need advice on how to secure my WCF web service hosted in IIS. I am new to WCF and would appreciate any sample code, articles to help me restrict access to my WCF service.

I am in the process of testing and deploying a WCF service that will be available on the internet. I need to secure the web service so that only authorized clients can use the service. I need to be able to detect who the client is making the call to the service. The group I am building this service for wants to use Certificate authentication or IP address to Identify the themselves to call my web service. They do not want to use user name and password.

I have found several articles and code snippets for getting the IP address of the client and Certificate authentication. The problem I found using trying to get the IP address of the client is that since my web service his hosted behind a F5 or some type of reverse proxy I cannot get the true IP of the client. The IP that the web services get is the IP of the F5 or the reverse proxy.

For Certificate Authentication I followed the directions from the 9 simple steps to enable X.509 certificates on WCF located here I had a few problems using this setup for my web service. 1) To me it seemed like as long as the user presented a valid Certificate they would be able to call my web service.

2) Does Certificate Authentication work when the security mode is set to Transport? In my production environment only HTTPS traffic is allowed through. I setup a Certificate authention on my service following the steps outlined in the article. I used the SSL certificate assigned to my server for the web services. For the client outside the network the service is hosted on, I used one of the certificates I generated when i tested the code locally. I changed the authentication mode of the certificate to chain trust for both the client and the server. I was able to call the service and recieve a message. I thought that since my certificate was self generated using the makecert command that the web services would not authenticate the client for the service.

how I can secure my services to only allow a few approved clients to call call the service.

View 17 Replies

WCF / ASMX :: Trying To Access A Self Hosted Wcf Service?

Oct 3, 2010

I get this error when trying to access a self hosted wcf service...


Can someone explain what I need to do to get this to work, I do not have any cross domain policy file. And don't know how that is supposed to look like.

View 1 Replies

Security :: Passing User Credentials To WCV Service Hosted In IIS?

Mar 3, 2010

I'm running an ASP page that is using a WCF client to get some data. How can I set/pass the Network Credentials (of the user that performed the request, not the .net pool thread) on the WCF client so the WCF service will be able to perform impersonation using these credentials ?

View 1 Replies

Web Forms :: Creating Windows Service In Local System To Access DB In Hosted Server

Feb 8, 2013

Created a windows service for my local system for sending bulk mail and it is working.But the same if the want to access the db which is there in hosted server and want to install it in my local machine to access the db details from the server , is not working. While starting a service , it is stopping immediately. Is it possible to do so?

View 1 Replies

WCF / ASMX :: How To Access A Wcf Service Hosted On A Server Running On A Virtual Machine On A Windows 2008 R2 Hyperv

Jul 14, 2010

I am trying to access a wcf service hosted on a server running on a virtual machine on a windows 2008 R2 hyperv. When i access this service when running my website through code everything works fine how ever when i deploy the application on the local IIS , in the deployed mode i am getting an securityaccessdeined exception. My app is running on a IIS server on another virtual machine. The stack trace is as given below :

Environment Info: My app has built on .NET 4.0 framework using VS2010. My WCF services are based on .NET2.0 framework.
Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 14-07-2010 13:56:54

Event time (UTC): 14-07-2010 08:26:54

Event ID: dd1986e7e7dc4473beb908754c75a580

Event sequence: 4

Event occurrence: 1

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/1/ROOT/StratosTest-1-129235696025728041

Trust level: Full

Application Virtual Path: /StratosTest

Application Path: C:inetpubwwwrootStratosTest

Machine name: MC-NEWCODE

Process information:

Process ID: 1752

Process name: w3wp.exe

Account name: IIS APPPOOLASP.NET v4.0 Classic

Exception information:

Exception type: SecurityAccessDeniedException

Exception message: Access is denied.

Server stack trace:

at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)

at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:

at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

at VMMService.IVirtualMachineManagementService.GetAllVirtualMachines()

at Default2.Page_Load(Object sender, EventArgs e)

at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Request information:

Request URL: http://localhost/StratosTest/Dashboard.aspx

Request path: /StratosTest/Dashboard.aspx

User host address: ::1


Is authenticated: False

Authentication Type:

Thread account name: IIS APPPOOLASP.NET v4.0 Classic

Thread information:

Thread ID: 4

Thread account name: IIS APPPOOLASP.NET v4.0 Classic

Is impersonating: False

Stack trace: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

at VMMService.IVirtualMachineManagementService.GetAllVirtualMachines()

at Default2.Page_Load(Object sender, EventArgs e)

at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Custom event details:

View 1 Replies

Not Able To Execute Web Service Function Remotely When Site Hosted Even Web Service Ip Addresss Is...

Jan 5, 2011

I have 2.0 site which is calling web services hosted on another server. When i have an xml file from where web service ip for eg. www.mysite/webservice1/myservice.asmx is given. When i call the same server from developer machine using local networkit works fine.But the same is when hosted remotely and from client end when services is called reading xml fiile from client machine it given a message 'remote server not connecting'.

View 1 Replies

WCF / ASMX :: How To Call Web Service Hosted In Window Service And Having End Point Over Tcp

Aug 4, 2010

i have created a normal web service and i want to host it outside IIS. one idea i got is to use window service as hosting environment. i have created a web service and hosted it window service and its window service is running now.would anybody please let me know that how can i call web service hosted in window service binded over soap.tcp. here is my sample code.


View 1 Replies

C# - SecurityNegotiationException In WCF Service Hosted On IIS 6.0?

Jan 10, 2011

I have hosted a WCF service on IIS. The configuration file is as follows


If I host the service on ASP .NET Dev server, it work well but if I host on IIS above mentioned error occurs.

View 6 Replies

Using Autofac For DI Into WCF Service Hosted In Web Application?

Jul 28, 2010

I'm having trouble injecting services dependencies into my WCF service using Autofac 1.4.5. I've read and followed the Autofac wiki page on WcfIntegration but my debugging shows me that my WCF service is created by the System.ServiceModel.Dispatcher.InstanceBehavior.GetInstance() method and not by the AutofacWebServiceHostFactory. What am I doing wrong?

I've set up my ajax.svc file to look like the one in the example for use with WebHttpBinding:

<%@ ServiceHost Language="C#" Debug="true"
Service="Generic.Frontend.Web.Ajax, Generic.Frontend.Web"
Autofac.Integration.Wcf" %>

My WCF service class Ajax is defined like this:

namespace Generic.Frontend.Web
RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Ajax
public MapWebService MapWebService { get; set;}.....

The service already works fine but I can't get the Autofac bits (read: creation/injection) to work.

Removing the default constructor unfortunately leads to the following exception:

System.InvalidOperationException: The service type provided could not be loaded as a service because it does not have a default (parameter-less) constructor. To fix the problem, add a default constructor to the type, or pass an instance of the type to the host.

View 3 Replies

Automatic Initialization Of IIS-hosted WCF Service?

Dec 28, 2010

I have an ASP.NET web-site and a WCF service which is called from ASP. The problem is, that during the first client request the site loads aufully slow, cause some time-consuming static objects are being created inside the WCF service. Is it possible to call any service method (by doing this the wcf object will be created), when the site gets loaded in IIS? (I know there is a solution for this problem in ASP 4 and IIS 7.5, but i'd like to know what's about IIS6-7). It is something like "user emulation") Maybe i can add some event handlers in global.asax?

View 1 Replies

Security :: Can Use The Membership Provider Api On A Hosted Service

Oct 16, 2010

Can I use the membership provider api on a hosted service? I can create mssql databases but have no control over iis. Will I be able to use the membership admin webpage on the hosted service?

Am I correct in stating that the api uses ASPNETDB.MDF in the app_data folder as it's database?

View 2 Replies

How To Authorize Users On An WCF Service Hosted In A Website

Jan 29, 2010

I have a WCF service that runs in my web application that provides data to a Silverlight application and is defined as follows (with an appropriate .svc file)....

[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class DispatchService [code]...

The idea is that the user logs into the website and is then authorised for all services. I do not want to have a login aspect to my Silverlight application to authenticate users.Therefore I dont want anyone to be able to call my service who is not authenticated.

Could I...Somehow determine this for each Operation Contract. I had a look inside the OperationContext object but couldnt find anthing that stood out as a way to determine who the user was.Somehow attribute the ServiceContract so that the method can only be used by authorised users?Put something in my web.config to stop unathorised users from being able to access the folder containing the services?

View 1 Replies

ADO.NET :: The Model Folder Is Not Being Published To Hosted Service?

Feb 19, 2011

I am working with this tutorial .[URL] In Visual Studio under the WCF REST program called .. TeamTask.Service is see the folding folders and files

[folder] Properties
[folder] References
[folder] AppData
[folder] Model
[file] Global.asax
[file] TeamService.cs
[file] Web.config

Then I use Build...Publish TeamTask.Service to move this up to my shared hosted builds and publishes successfully

When I reset the client to my virtual directory on my opens and I get an error that I believe is because it can't find and records or tasks

When i look in the folder that was published to I find this:

[folder] AppData
[folder] bin this has a TeamTask.Service.ddl and TeamTask.Service.pdb
[file] Global.asax
[file] web.config

No folder for Model.

View 3 Replies

WCF / ASMX :: Call A Web Service Which Is Hosted In .net Framework?

Oct 11, 2010

I am trying to call a web service which is hosted in .net framework.

Here is my piece of code:

function ValidateUser()
set objSoapClient = server.CreateObject("MSSOAP.SoapClient30")
objSoapClient.ClientProperty("ServerHTTPRequest") = True
Call objSoapClient.mssoapinit("","UserWS")
End function

And i call the function as


It is giving error as

Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/asp/index.asp, line 12

i am working on .net and new on asp.I haven't worked on asp and it was pretty easy to call through visual studio in .net but can't do the same for asp

View 3 Replies

How To Get ComputerName Of The Webserver Where WCF Service Is Hosted Inside Application

Apr 9, 2010

I have an web application which have one WCF hosted inside a .svc file

<%@ ServiceHost Language="C#" Debug="true" Service="MYNameSapce.BatchService" %>

this service is access by some desktop application which have referenced it.

In one of my WCf service method i have to access the path which i were able to get via

string filePathTemp = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + @"UploadFiles" + request.FileName;

Now in one of the method i wanted to get the computer Name of the server.

View 2 Replies

Security :: Share Certificate Between Website And Self-hosted Wcf Service

Feb 12, 2010

If I buy a CA certificate for the one site on the webserver, can I use the same certificate on a self-hosted wcf service.

The wcf service will use wsHttpBinding with username/password authentication.

View 2 Replies

AJAX :: Error While Calling Web Service Hosted In Java

Jun 29, 2010

When I am trying to call a service hosted in Java through .net I am encountering the below error

"WSE839: An HTTP response was received that used the following content type: text/xml; charset=utf-8. The following content type was expected: multipart/related; type=application/xop+xml."

I am using WSE 3.0 for configuring MTOM.

View 2 Replies

C# - Add User Page To Hosted Website?

Oct 1, 2010

I have a website that my company hosted using hubspot.. now the guy who made it is gone..

Currently all the code is in the front end which i think was made by using the CMS tool of hubspot.

What i need to do is add another page to this website which has my code and also has a backend code in it.

how do i proceed.. i am currently working with and C#...

which language i should chose to do the backend coding.. the code i plan to write is not that complex.. i just need to get a value for the user using a textbox, multiply with a number and display/email it back.

View 1 Replies

AJAX :: Control Toolkit Not Working When Website Hosted In IIS Server

May 7, 2015

I am using most of the Ajax Control, but when I deployed it in IIS. It is not working.

View 1 Replies

Winform Control Hosted In IE, FileIO Security Exception / How To Solve This Error Message

Nov 4, 2010

I see a message on:

winform control hosted in IE, FileIO security exception.

I have got the same problem, which I cannot figure out what is the solution for weeks.

I have Windows 7 (Home premium edition), framework 3.5 (how can I check that, if gacutil is correct version, if it metters, anyway ...)

I am writting on C#.

Also on assemblyInfo.cs :


View 5 Replies

How To Autheticate A Domain User From The Web Application Hosted On Another Domain

Jul 28, 2010

I have two domain servers X and Y.My Web application is hosted on Domain X.But my scope is required to authorize the user of Domain Y on the Web application hosted on Domain X server.I am using Windows Authetication mode in application

View 2 Replies

WPF Connect To A Hosted DB?

Apr 2, 2010

I am trying to build a CRM database for my office, but would like to have the ability for users to use it from home as well, and possible an IPhone app to check contact information. I'd like to use WPF, so I could have an application at the office, but also be able to log in at home to the same database, and have multiple users.

Is it possible to have WPF connect to a hosted DB? And possibly have a web form interface, for access through a browser on outside of intranet machines? Or do I need to just go the route of creating a site, and use and everyone access that through the browser?

View 2 Replies

How To Pass Data From Javascript To Winforms User Control

Mar 23, 2010

I have a windows user control hosted in IE.

how can i paas input from webpage ( propably from javascript ) to win forms user control

View 1 Replies

Breakpoints Not Being Hit In Webservice Hosted In IIS

Aug 31, 2010

I am trying to debug a webservice that is hosted in IIS. When I open it through Visual Studio as a website, put a breakpoint and run it, it is executing as expected but none of the breakpoints are being hit. When I remove the virtual directory from IIS, I am able to hit the break points. One of the suggested solutions was to attach aspnet_wp process during Debug. But the aspnet_wp is not running on the system (I have checked the options 'Show processes from all users' and 'Show processes from all sessions').

View 3 Replies

Copyrights 2005-15, All rights reserved