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
Similar Messages:
Jul 23, 2012
How to Protect Web services from Un authenticated users.. right now Im Using Protected Access specifiers.. Is it Correct method To Protect Web services?
View 1 Replies
Oct 27, 2010
The behaviour I would like is for a user to be able to visit a custom built website and if they are already authenticated against sharepoint for the custom website to know who they are and give them various rights. If they are not recognised by sharepoint then I would like them to login to sharepoint and be directed back to the custom website. Sharepoint picks its users and groups up from Active Directory. I don't know much about the internals of the server, but the custom one will be in a separate domain (I think) though I have full control over the custom and moderate control over the SP infrastructure.
View 1 Replies
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
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
Feb 4, 2011
I'm trying to add a directory for anon access in IIS 7.5. It works under Web Dev but not IIS 7.5
I'm currently using this web.config in the directory. This is a directory with style sheets:
<?xml version="1.0"?>
Note: As an alternative to hand editing this file you can use theweb admin tool to configure settings for your application. Use the Website->Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in WindowsMicrosoft.NetFrameworkv2.xConfig
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</configuration>
Update:
I've went to the folder and under Authentication, I've changed anonymous authentication from IIS_USR to pool. This seems to have correct it.
I will reward anyone who provides a very good explanation and resources for understanding this setting. Also, how to apply it globally would be good to know -- for all folders.
View 2 Replies
Feb 5, 2010
I've an application that runs in a localhost.
So I can get the user logon to some recording data or some thing else.
I was thinking if that was possible to put some value in web config that gets the user logon and if that logon is authorizated for that page it let him open else it close the page...
Some one have some idea to accomplish it ?
View 5 Replies
May 18, 2010
How can I authorize and authenticate users by roles? I have roles table and user's table, role Id is the primary key in the roles table and foreign key in the user's table.
View 4 Replies
Feb 21, 2011
I am currently working on a project in which I am assigned to provide e-mail features to the users of our site. unlimited users can create there mail accounts dynamically with our servername say if the website address is www.xyz.com then the users of this site can create their mail boxes like user@xyz.com. My clients want to provide e-mail service like yahoo, gmail, aol, hotmail, rediffmail, zapakmail, etc...
View 4 Replies
Mar 26, 2010
Need to develop a Web application that will be used to authenticate and authorize internal and external users to log and then re-route to web applications for the organization. The login application should be able to provider smooth integration with any future applications that needs a secured authentication. Should I be using WIF - Claims based Identity/ADFS or asp.net Role membership provider to develop this app.?
View 1 Replies
Jan 5, 2011
I have asp.net 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
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.
[Code]....
[Code]....
View 1 Replies
Jan 10, 2011
I have hosted a WCF service on IIS. The configuration file is as follows
[code]....
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
Oct 3, 2010
I get this error when trying to access a self hosted wcf service...
[Code]....
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
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"
Factory="Autofac.Integration.Wcf.AutofacWebServiceHostFactory,
Autofac.Integration.Wcf" %>
My WCF service class Ajax is defined like this:
namespace Generic.Frontend.Web
{
[ServiceContract]
[AspNetCompatibilityRequirements(
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
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
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
http://www.codeproject.com/KB/WCF/9StepsWCF.aspx?msg=3181718. 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
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
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 server....it builds and publishes successfully
When I reset the client to my virtual directory on my domain...it 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
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("http://10.13.222.240:81/megaservice/UserWS.asmx?WSDL","UserWS")
ValidateUser=objSoapClient.IsUser(2)
End function
%>
And i call the function as
<%
=CalculateDiscount
%>
It is giving error as
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/asp/index.asp, line 12
800401f3
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
Apr 9, 2010
I have an Asp.net 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
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
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
Feb 9, 2010
I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an encrypted password format), and a SqlRoleProvider. I need to know if it's possible to administer the users (create new users, assign them to roles, etc.) from a windows application - the powers that be don't want any administrative functionality in the web app itself.
Here is the membership provider definition from web.config:
[code]....
So, obviously, I have a Sql Server database that contains the users and roles for the web app. I'd like to create a separate windows app that references the web app assembly, and use the configured MembershipProvider, RoleProvider, and machineKey to create users, assign users to roles, etc. If that's not possible, I can duplicate the configuration settings from web.config within the windows app. But I don't know how to do this either.
View 3 Replies
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 asp.net 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