How to force one method in WCF Rest to be called via https, while others can be called via http

Is there a way in implementing WCF Rest Service to require one method to be called via https and the other called via http or https without the need to define two service endpoint bindings? I want to be able to do something in my service implementation, for example:

if (CalledOverHttps()) {
   //Do Stuff
} else {
   throw new WebOperationException("Nice try buddy");
}

Thanks in advance!

+1
source share
2 answers

I handled this using IIS and required https in the virtual directory. Therefore, in my directory structure there are:

not protected: http://foo.com/someservice.svc

: https://foo.com/secure/someservice.svc

http://foo.com/secure/someservice.svc, IIS 500.

+1

, , .

, .

0

Source: https://habr.com/ru/post/1732112/


All Articles