Client Application Services in VS2008

Just ran in to an issue of security when having many web applications.  I needed all the web application to use the same security access, after a little research I found that Client Application Services in VS2008 works a treat, as it has been written to handle security in the cloud.

I found a few good articles on the subject

Client Application Services with Visual Studio 2008

Implementing Application Security with Client Application Services in VS2008 

Best of all I just love how it handles if your remote server is off line or not available

ConnectivityStatus.IsOffline = true; 

To get this working in your web application you will need to make a few changes to the Web.Config, and then point the serviceUri to your service

 

<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <section name="testing_Security.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>

<appSettings>
   <add key="ClientSettingsProvider.ServiceUri" value="http://localhost:55666/AppServices/Profile_JSON_AppService.axd" />
</appSettings>

 

<membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="http://localhost:55666/AppServices/Authentication_JSON_AppService.axd" />
      </providers>
</membership>

<roleManager defaultProvider="ClientRoleProvider" enabled="true">
      <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="http://localhost:55666/AppServices/Role_JSON_AppService.axd" cacheTimeout="86400" />
      </providers>
    </roleManager> 

Web.config (8.75 kb)

blog comments powered by Disqus

About the author

You have probably figured out by now that my name is Bryan Avery (if not, please refer to your browser's address field).  Technology is more than a career to me - it is both a hobby and a passion.  I'm an ASP.NET/C# Developer at heart...

Month List