I am writing a WCF service using .NET 4.5 and SimpleInjector. It is a REST service (using http/get/post).
I need to add an authorisation layer to my service. After a lot of messing around, I now have a custom authorisation manager based on ServiceAuthorizationManager.
All the examples I've seen (and I have found many) have hard coded username and password checking. I would like to use a database, and therefore want to inject the data layer into my class. If I change the constructor to take a parameter, it throws an exception "No parameterless constructor defined for this object".
This is the example I based my code off: https://msdn.microsoft.com/en-us/library/ms731774(v=vs.110).aspx I added a constructor with an interface:
public class MyServiceAuthorizationManager : ServiceAuthorizationManager
{
public MyServiceAuthorizationManager (IMyDataLayer mdl)
{ ...
Custom "Basic" Authentication for my WCF services. REST and RIA. Possible?