0

I have written a role provider which assumes Windows authentication and so far works well with WCF services and ASP.NET. Is it possible to use it also with a console/WPF/WinForm application? I tried a configuration like this on a very simple console app but the Initialize method of the provider doesn't even get called (thanks in advance):

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

    <system.web>

        <authentication mode="Windows" />

        <roleManager enabled="true"
                     defaultProvider="Authorization.RoleProvider">
            <providers>
                <clear/>
                <add name="Authorization.RoleProvider"
                     type="Authorization.RoleProvider, Authorization.RoleProvider"
                     applicationName="urn:AuthorizationDemo:Program"
                     authorizationServiceUrl="net.pipe://localhost/Authorization/Authorization.svc"/>
            </providers>
        </roleManager>
    </system.web>

</configuration>
Valo
  • 1,872
  • 2
  • 15
  • 23
  • Your `system.web` configuration is not going to do a whole lot outside of an ASP.NET website. There may be a way to make this work but it's not going to happen automatically. – joshuahealy May 20 '13 at 22:23
  • I kind of suspected that but saw some articles out there that do exactly this without any extra work and thought I might ask around. The other reason is that the system.web section works well in a WCF console app host, as an example outside of ASP.NET. – Valo May 21 '13 at 14:06
  • Surely those articles had some explanation or some example code you could look at? Sorry it's not something I've done before so I can't help much. – joshuahealy May 22 '13 at 01:57

0 Answers0