Sometime you may have a requirement to tell your client what type of authentication scheme you are applying on your WCF REST service. In this article I will show you, "How can you expose authentication scheme information as part of your service?". To start with let us create a Self Hosted WCF REST Service. Besides other resources [OperationContracts] of your REST Service add a function to return Authentication type as a string in a Service Contract.We are returning an authentication scheme as a string. If you don't have any other functions than GetAuthenticationType() then your service contract would look like below: IService1.cs using System.ServiceModel;using System.ServiceModel.Web;namespace WcfService13{ [ServiceContract] public interface IService1 { [OperationContract] [WebGet(UriTemplate = "/GetAuthenticationType")] string GetAuthenticationType(); } }Now we need to implement the service to return the authentication scheme. In the implementation:
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: