7

Can I secure my WCF service using AWS authentication. I am tring to figure this out by google search and finding articles on calling a service that is already secured using AWS authentication. Not an article of how to secure a WCF service with AWS. Isn't there an option, is my understanding of AWS authentication and signing wrong about this. Please point me to an article to start with.

Esen
  • 973
  • 1
  • 21
  • 47
  • To the sake of teaching how to (not) search for this kind of issue, we should publish the searches that do (not) worked to find answers to your problem!! – Rafareino Jan 18 '16 at 13:26
  • Are you talking about WCF SOAP services or WCF REST services? – MvdD Jan 23 '16 at 22:54

1 Answers1

1

I'm going to assume your intend is to create a WCF REST service that uses an HMAC based authentication scheme like Amazon S3 is using.

The way to implement this is to create your own WebServiceHost and override the ApplyConfiguration method. In this method, you set a new ServiceAuthorizationManager.

this.Authorization.ServiceAuthorizationManager = new MyServiceAuthorizationManager();

Derive the MyServiceAuthorizationManager class from WCF's ServiceAuthorizationManager and override the CheckAccessCore method.

class MyServiceAuthorizationManager : ServiceAuthorizationManager
{
    protected override bool CheckAccessCore(OperationContext operationContext)
    {
        // check the validity of the HMAC
        // return true if valid, false otherwise;
        return IsValidHMAC(WebOperationContext.Current);
    }
}

For more details on the implementation of the algorithm, see this answer.

Community
  • 1
  • 1
MvdD
  • 22,082
  • 8
  • 65
  • 93
  • Exactly what I was looking for, sorry my bounty has expired, let me open a bounty again and try to award you the bounty points – Esen Jan 26 '16 at 21:12