c# - Lightswitch server with windows authentication and anonymous WCF Services -



c# - Lightswitch server with windows authentication and anonymous WCF Services -

we have developed set of applications our intranet lightswitch. of them runs using windows authentication, have develop wcf services (hosted in ls applications) must allow anonymous connections.

that's current web.config settings of exposed services:

<system.web> <authentication mode="windows"> <forms name="main" /> </authentication> <identity impersonate="true" /> </system.web> <system.servicemodel> <services> <service behaviorconfiguration="metadatasupport" name="lightswitchapplication.wcf.helperservice"> <endpoint address="" binding="custombinding" bindingconfiguration="lightswitchapplication.wcf.helperservice.custombinding0" contract="lightswitchapplication.wcf.helperservice" /> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange" /> </service> </services> <bindings> <custombinding> <binding name="lightswitchapplication.wcf.helperservice.custombinding0"> <binarymessageencoding /> <httptransport authenticationscheme="anonymous" /> </binding> </custombinding> </bindings> </system.servicemodel>

after digging here , msdn still haven't found if there way reach behaviour.

everything works fine when access these services windows credentials, have found no way utilize services anonymous authentication. have tried changing binding mode, adding decoration services:

[servicecontract(namespace="")] [aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.allowed)] [allowanonymous] [securitypermission(securityaction.assert)] [overrideauthentication()] [authorize(users="*")] [overrideauthorization()] public class helperservice { ... }

i have tried utilize tag in web.config, , setting wcf folder application under main one, in case problems different, , related compliation path , dll directory path. tried solve with:

<location path="wcf"> <system.web> <authentication mode="none" /> <compilation> <codesubdirectories> <add directoryname="../bin"/> </codesubdirectories> </compilation> </location>

but still receive error because iis still doesn´t find assemblies: not load file or assembly 'microsoft.lightswitch.server, version=12.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. scheme cannot find file specified.

description: unhandled exception occurred during execution of current web request. please review stack trace more info error , originated in code. exception details: system.io.filenotfoundexception: not load file or assembly 'microsoft.lightswitch.server, version=12.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. scheme cannot find file specified. source error: unhandled exception generated during execution of current web request. info regarding origin , location of exception can identified using exception stack trace below. assembly load trace: next info can helpful determine why assembly 'microsoft.lightswitch.server, version=12.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' not loaded. === pre-bind state info === log: user = iis apppool\defaultapppool log: displayname = microsoft.lightswitch.server, version=12.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a (fully-specified) log: appbase = file:///c:/inetpub/wwwroot/myapp/wcf/ log: initial privatepath = c:\inetpub\wwwroot\myapp\wcf\bin calling assembly : (unknown). === log: bind starts in default load context. log: using application configuration file: c:\inetpub\wwwroot\myapp\wcf\web.config log: using host configuration file: c:\windows\microsoft.net\framework64\v4.0.30319\aspnet.config log: using machine configuration file c:\windows\microsoft.net\framework64\v4.0.30319\config\machine.config. log: post-policy reference: microsoft.lightswitch.server, version=12.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a log: attempting download of new url file:///c:/windows/microsoft.net/framework64/v4.0.30319/temporary asp.net files/myapp_wcf/88e6cc1b/e1821fec/microsoft.lightswitch.server.dll. log: attempting download of new url file:///c:/windows/microsoft.net/framework64/v4.0.30319/temporary asp.net files/myapp_wcf/88e6cc1b/e1821fec/microsoft.lightswitch.server/microsoft.lightswitch.server.dll. log: attempting download of new url file:///c:/inetpub/wwwroot/myapp/wcf/bin/microsoft.lightswitch.server.dll. log: attempting download of new url file:///c:/inetpub/wwwroot/myapp/wcf/bin/microsoft.lightswitch.server/microsoft.lightswitch.server.dll. log: attempting download of new url file:///c:/windows/microsoft.net/framework64/v4.0.30319/temporary asp.net files/myapp_wcf/88e6cc1b/e1821fec/microsoft.lightswitch.server.exe. log: attempting download of new url file:///c:/windows/microsoft.net/framework64/v4.0.30319/temporary asp.net files/myapp_wcf/88e6cc1b/e1821fec/microsoft.lightswitch.server/microsoft.lightswitch.server.exe. log: attempting download of new url file:///c:/inetpub/wwwroot/myapp/wcf/bin/microsoft.lightswitch.server.exe. log: attempting download of new url file:///c:/inetpub/wwwroot/myapp/wcf/bin/microsoft.lightswitch.server/microsoft.lightswitch.server.exe.

ok, no matter this... re-create total bin folder parent folder myapp/wcf (just testing, i'll solve later) , application loads, but... 401.2 error:

error message 401.2.: unauthorized: logon failed due server configuration. verify have permission view directory or page based on credentials supplied , authentication methods enabled on web server. contact web server's administrator additional assistance.

i have created web.config in wcf folder, allowing anonymous access in way:

<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <security> <authentication> <anonymousauthentication enabled="true" /> <windowsauthentication enabled="false" /> </authentication> <authorization> <add accesstype="allow" users="?" /> </authorization> </security> </system.webserver> <system.web> <identity impersonate="false" /> </system.web> </configuration>

i need help solve it, because it's driving me crazy. want reuse business logic defined in our lightswitch apps, still don't know if i'm going able such 'silly matter'

can tell me right way on, please?

thanks lot.

c# iis wcf-security visual-studio-lightswitch lightswitch-2013

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -