Just2Click
Just2Click

Reputation: 545

How to create a secured/private WCF service

I want to create a WCF service that may be accessed only on localhost. I couldn't find any reference for that, is that possible? All the posts I had found talked about this scenario as a bug, well I'd like it as a feature.

Any ideas?

Upvotes: 1

Views: 379

Answers (3)

Tad Donaghe
Tad Donaghe

Reputation: 6588

A WCF service should be agnostic about how it's hosted or accessed.

Whatever's hosting the service, on the other hand, determines how the service can be accessed.

As Mike Goodwin suggested, having your host only allow netNamedPipeBinding will restrict the service to only be accessible via the machine that the host is running on.

Here's an article on the various transport protocols, including named pipes.

Here's a pretty in depth article on hosting WCF services.

Upvotes: 1

Mike Goodwin
Mike Goodwin

Reputation: 8880

If you're flexible on protocols, you could use a netNamedPipeBinding hosted in a Windows service.

Upvotes: 3

Guvante
Guvante

Reputation: 19213

You can configure the binding for the web site it is attached to and change it to localhost, rather than *. If you are hosting other services that need external access you can always create a new web site on a different port, such as localhost:8000.

Upvotes: 1

Related Questions