wcf-security

How to authenticate user while calling WCF service using AJAX?

我们两清 提交于 2019-12-03 08:36:40
I have a WCF service which needs to be called from client side(ajax call). I want to use ScriptManager on ASPX page to add a ServiceReference to the WCF service (or) JQuery ajax call to the WCF service. I want to deny anonymous users accessing the WCF service. Is there any way to do user authentication before calling a service method from JavaScript? how to secure my WCF service calls from client side? There are a number of things you can do to secure your WCF services. Probably the easiest way is if your services are already part of the existing overall ASP.NET application is to enable ASP

WCF client endpoint: SecurityNegotiationException without <dns>

时光毁灭记忆、已成空白 提交于 2019-12-03 08:31:53
问题 I'm having a strange situation here. I got it working, but I don't understand why. Situation is as follows: There is a WCF service which my application (a website) has to call. The WCF service exposes a netTcpBinding and requires Transport Security (Windows). Client and server are in the same domain, but on different servers. So generating a client results in the following config (mostly defaults) <system.serviceModel> <bindings> <netTcpBinding> <binding name="MyTcpEndpoint" ...>

WCF, Security and Certificates

旧时模样 提交于 2019-12-03 07:52:27
问题 I have a client/server WCF application that needs some sort of user authentication against a database. The application (both client and server together) is being developed to be sold to dozens of customers, for use on their intranets. We're not too worried about encrypting most of the data moving across the wire, except of course during authentication. Thinking about WCF security, I keep coming back to the idea that we should be making use of x509 certificates. However, our customers will

How to Authenticate and Authorize every WCF call?

五迷三道 提交于 2019-12-03 07:03:02
I have WPF client consuming WCF service hosted in IIS. For authentication I am thinking of either certificate or user name authentication. Client calls couple of methods in WCF and passes some message. For every call that comes to WCF, I want to authenticate the user. To place message in db, I have to know who is the caller, what is their username and few other properties about the user. How to pass these info[may be a small object] on every call? This is the recommended default behavior - each call to the WCF service gets a new instance of the service, and each call is authenticated and

What's the difference between retrieving WindowsPrincipal from WindowsIdentity and Thread.CurrentPrincipal?

≯℡__Kan透↙ 提交于 2019-12-03 06:08:40
I am trying to work out why attribute based security isn't working as I'd expect in WCF and I suspect it might have something to do with the following: AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); var identity = new WindowsIdentity("ksarfo"); var principal = new WindowsPrincipal(identity); Console.WriteLine("\nChecking whether current user [" + identity.Name + "] is member of [" + groupName + "]"); Console.WriteLine(principal.IsInRole(groupName)); // returns true principal = (WindowsPrincipal)Thread.CurrentPrincipal; identity = (WindowsIdentity) principal

How to use System.IdentityModel in own client-server application

蓝咒 提交于 2019-12-03 03:56:42
问题 I've got a simple client-server application based on TcpClient/TcpListener and SslStream. Clients can authenticate themselves to the server using a X509Certificate or by sending a user name and password after the SslStream has been established. WCF makes use of the System.IdentityModel namespace for authentication purposes, but apparently that can be used in arbitrary applications--which sounds interesting. Information on how to do this is sparse though (or my Google foo is weak today). So,

Using ASP.NET Membership Provider authentincation in a WCF service

大憨熊 提交于 2019-12-03 03:51:31
问题 Is there a way to use the same username and password from the membership provider for a WCF service authentication? if so, which binding does it supports? I need to extract a profile variable from the user currently calling the service. Thanks for any help. 回答1: Basically any binding that accepts username/password as client credentials for message security can be configured to use the ASP.NET membership provider. Check out this MSDN docs on how to use the ASP.NET Membership provider in WCF -

Connect with WCF to a WebService authenticated with username/password

核能气质少年 提交于 2019-12-03 03:49:37
问题 I created a proxy of a Web Service with Visual Studio 2008, and it created for me the following entry in the app.config: <system.serviceModel> <bindings> <basicHttpBinding> <binding name="MyNameHandlerSoapBinding" 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" messageEncoding=

WCF REST RequestInterceptor authentication

北慕城南 提交于 2019-12-03 03:46:44
I am trying to do some basic authentication in a WCF RequestInterceptor. I am using this article as a start. The problem I am running into is communicating between the interceptor and the service. Nothing I have tried seems to work. So far, I have tried: OperationContext.Current requestContext.RequestMessage.Properties[HttpRequestMessageProperty.Name]["foo"] = value HttpContext.Current.Request But no matter what I set, I can't seem to access it in the service behavior itself: [AspNetCompatibilityRequirements( RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed )] [ServiceBehavior(

Securing WCF service using basicHttpBinding which supports streaming

自作多情 提交于 2019-12-02 18:28:42
My question is in regards to the best (aka "least painful") way to secure access to a WCF service that is only exposed to our company's internal users. The goal is to ensure that the service is only accessed via a single Windows forms application that each of our users has installed. When the service is called, I want the service to be able to validate that it was called from the permitted application. The service to be secured uses basicHttpBinding, which supports streaming, so I believe I am limited to Transport level security. Below are simplified versions of the <bindings> and <services>