Security :: MembershipProvider / RoleProvider With Server Farm

Nov 16, 2010

I trying to understand how a server farm would use MembershipProvider / RoleProvider. If I have a million users, I do not want to have multiple copies of the MembershipProvider / RoleProvider database. I would like to have one set of machines used for login but then redirect users to other machines in the server farm depending applications the users decide to use. However, once they are redirected to the new machine, I do not want the user to have to relogin. I want the credentials and role information to be available.

Does anyone know how MembershipProvider / RoleProvider is configured for this type architecture?

View 4 Replies


Similar Messages:

Security :: Custom MembershipProvider / RoleProvider With Login

May 18, 2010

I have created a custom MembershipProvider and RoleProvider which communications with some existing business logic. The issue I have is that the user login in my business logic requires 3 arguments (group id, user id, and password) and the MembershipProvider and RoleProvider I implemented just use 1 or 2 arguments (username, password). Right now I append my group id and user id together and pass it as the username then parse it in the implemented methods. Is there a better way to do this?

Note, I can handle the login fine because I can call my own ValidateUser method. The main issue is when the implemented methods are called from other things like the RoleProvider.GetRolesForUser(username) method when I use the AuthorizeAttribute.

[Code]....

[Code]....

View 1 Replies

Security :: Are Cookies Required In Order To Use MembershipProvider And RoleProvider

Dec 25, 2010

Does Forms Authentication require that cookies be enabled to use MembershipProvider and RoleProvider? If so, can anyone tell me the minimum security level I need to tel clients to use.

View 2 Replies

Security :: RoleProvider And MembershipProvider Connect To Different Types Of Databases?

Aug 31, 2010

Say for my ASP.NET application, I have implemented my custom RoleProvider by using my existing Users table on my Oracle 11g database. Then, for my Membership Provider, can I still use the AspNetSqlMembershipProvider that comes with the .NET framework and uses SQL Server?

View 4 Replies

Security :: Can't Deploy Custom MembershipProvider / RoleProvider Assembly To Website

Oct 15, 2010

I have written an assembly (DLL) containing two classes, MyMembershipProvider and MyRoleProvider, which are derived from MembershipProvider and RoleProvider, respectively. I have implemented most but not all of the abstract methods; the remaining ones all throw a NotImplementedException. I have signed the assembly and added a reference to it in my web-site project, where the relevant web.config sections look like this:

[Code]....

When I fire up the site, however, I get the following error:

Configuration Error

Description:
An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:
Exception has been thrown by the target of an invocation.

The error message points to the <add /> tag in the <roleManager /> section: if I take that out, however (enabled="false"), it comes back again as soon as I try to log-in to the site (this time pointing to the membership section). I have verified that is recognising the classes by changing the name in the "type" attribute (to something that doesn't exist), at which point it throws a different error. Therefore I'm presuming there's a problem with my assembly code somewhere; but how can I find out where? I have debug=true in the web.config and also compiled the assembly with Debug options, but no clues.

View 4 Replies

Configuration :: Put MembershipProvider, ProfileProvider And RoleProvider In One Single External Config File?

Oct 5, 2010

How can I put MembershipProvider, ProfileProvider and RoleProvider in one single external config file?

View 1 Replies

Security :: How To Extend The RoleProvider To Have Custom Code

Feb 24, 2010

I am obviously missing something here and it is driving me batty. I am trying to implement a custom role provider so that I can add some of my own custom code to it. I have created my CustomRoleProvider class, I have inherited the RoleProvider base class and implemented its members. I have made the required changes to my web.config so that my CustomRoleProvider is used. This is all working great.

All of this is wrapped up in a wrapper class as provided by the MVC Membership Starter Kit that I am using and wish to extend.

Now I want to add my own custom functionality.

When I add a function to my CustomRoleProvider I cannot see it or access it.

How do I add functionality to my CustomRoleProvider so that I can use it?

View 1 Replies

Security :: Get Custom RoleProvider To Invoke Its Methods On Every Page Load

Jun 18, 2010

I had a post here [URL] that I need to expand on now. I have a few web pages that need to check for a certain role on each page request. I have a custom Membership Provider and a custom Role Provider (called CustomRoleProvider - very original - I know) that I am using to do this. When a user logs in, the CustomRoleProvider.GetRolesForUser() method is called automatically (by the urlAuthorizationModule). When this method gets called, I am currently adding a role to the roles string array that allows/permits the user from viewing the web pages of concern based on certain qualifications that are determined elsewhere in the code (i.e. the database is queried to see if the user has rights to visit certain pages).

This approach only gets me half way because the user's roles are only checked once at login. When I wrote my previous post, I thought the CustomRoleProvider was broken because it wasn't calling the IsUserInRole() method on each page request. According to Microsoft, "The IsUserInRole method is called by the IsUserInRole method of the Roles class to determine whether the current logged-on user is associated with a role from the data source for the configured ApplicationName." (that information comes from this page:

[URL] Reading that description I thought it was being called automatically on each page request. This is not correct. What I need to know how to do is to get a method in the CustomRoleProvider that returns a boolean to be called automatically on each page request so I can update the user's roles if they change while the user is logged into the web site. For example, if the user has rights to visit page A and then five minutes later his rights are revoked, he can't visit page A again unless he contacts an admin to reset his rights.

View 1 Replies

Security :: Get The ConnectionStringName Of MembershipProvider?

Nov 12, 2010

i have a class library for membership provider and inherits from System.Web.Security.sqlMembershipProvider

i just want to change somthing in it this class library will work in difrent web form application

i need to get the connectionStringName in web.config where the membership set to work with it.

how can i get the connectionStringName?

View 3 Replies

Security :: Membershipprovider And Requiresuniqueemail=false?

Jun 7, 2010

I'm working with the default asp.net membershipprovider. Now, by default, that requires that all members registere have all unique email-addresses.However, I'd like to override that because, in a code behind of a certain webpage, I do not need emails to be unique.

View 4 Replies

Security :: Unit Testing MembershipProvider?

Nov 21, 2010

I'm trying to unit test the MembershipProvider, however I cant figure out how or whether there is any need for unit testing of it...My business layer:

[Code]....

The only examples I've found so far requires a "MockMembershipProvider" with a local database setup... seems quite odd to me.

View 1 Replies

Security - How To Sanitize Input From C# MembershipProvider Controls

Jan 9, 2010

I'm using various ASP.NET controls out of the box such as the CreateUserWizard control, Login control etc... For custom controls, I have sanitized my inputs by making sure they conform to expected values. However, is this required for the controls such as the CreateUserWizard control, or is that handled internally? Do I need to provide any extra server side validation to these controls and, if so, would it be best to do it in the "CreateUserWizardControl_CreatingUser" event?

View 2 Replies

Security :: Send Mail After MembershipProvider.ResetPassword?

Jan 21, 2010

I have a web page, where the administrator can reset other users password.I am not using any membership controls here.I found that i can use Membership.Provider.ResetPassword() function.But i want to send the new password to the user through the mail, just like in password recovery control, reusing the mail configuration in the web.config file(which membership use with the password recovery control).Do i need to explicitly do the coding for sending the mail, using SMTP client, and mail message class?or is there any builtin functionality inside membership for this just like in password recovery?

View 8 Replies

Security :: RoleProvider Error "processing Of Configuration File" For Windows 2003

Feb 2, 2010

I am getting an error with my custom RoleProvider (based on System.Web.Security.RoleProvider) initializing in my ASP.NET application. The error is: "Description: An error occurred during the processing of a configuration file required to service this request." I see this below error happening on a Windows 2003 server with .NET 3.5 SP1. I have not seen it on Windows 2008 servers, and have not seen the error when the ASP.NET application was built under .NET 2.0 (running on this same server). Any thoughts on the nature of the error?

Classification: UNCLASSIFIED

Caveats: NONE
Server Error in '/Assist' Application.
Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: FrameworkRoleProvider_Initialize

Source Error:

Line 122: <clear />
Line 123: <add
Line 124: type="Grb.Security.FrameworkRoleProvider"
Line 125: applicationName="MyApplication1" />
Line 126: </providers>

Source File: D:inetpubAssistweb.config Line: 124

Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

HERE'S THE INITIALIZING FUNCTION FOR THE ROLE PROVIDER:

Public Overloads Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection)

Try
If config Is Nothing Then
Throw New ArgumentNullException("config")
End If
If String.IsNullOrEmpty(name) Then
name = Me.GetType().BaseType.Name
End If
If String.IsNullOrEmpty(config(DescriptionKey)) Then
config.Remove(DescriptionKey)
config.Add(DescriptionKey, SR.GetString(SR.RoleSqlProvider_description))
End If
MyBase.Initialize(name, config)
' Get the configuration settings
Dim configurationSettings1 As Grb.Framework.Business.ConfigurationSettings = Grb.Framework.Business.FrameworkConfiguration.GetConfiguration()
' Load the DomainManager

Dim dataManager1 As New Grb.Framework.Data.Main(Nothing, configurationSettings1.FrameworkSchema, configurationSettings1.AssistSchema, _
configurationSettings1.ConnectionString, configurationSettings1.ProviderInvariantName, _
configurationSettings1.EnablePerformanceLogging, System.Web.HttpContext.Current.Request.PhysicalApplicationPath)
' Load the DomainManager
Dim frameworkDomainManager As Grb.Framework.Business.DomainManager = New Grb.Framework.Business.DomainManager(dataManager1, -1, -1)
m_ProductDomainManager = New Grb.PlugIn.Assist.Business.DomainManager(dataManager1, frameworkDomainManager)
m_ApplicationName = config(ApplicationNameKey)
If String.IsNullOrEmpty(m_ApplicationName) Then
m_ApplicationName = SecUtility.GetDefaultAppName()
End If
If m_ApplicationName.Length > 256 Then

Throw New System.Configuration.Provider.ProviderException(SR.GetString(SR.Provider_application_name_too_long))

End If
config.Remove(ApplicationNameKey)
If config.Count > 0 Then
Dim attribUnrecognized As String = config.GetKey(0)
If Not String.IsNullOrEmpty(attribUnrecognized) Then

Throw New System.Configuration.Provider.ProviderException(SR.GetString(SR.Provider_unrecognized_attribute, attribUnrecognized))

End If
End If
Catch ex As Exception
Throw New Grb.Framework.Core.Exceptions.FrameworkBusinessException( _
Resources.ExceptionMessages.FrameworkRoleProvider_Initialize, ex)
End Try
End Sub

WEB.CONFIG:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"
/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"
/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"
/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<connectionStrings>
<!-- example: <add name="ConnectionString" value="Data Source=MyServer;User Id=GRB_WEB_USER_10;Password=temp;" providerName="Oracle.DataAccess.Client" /> -->
<add name="FrameworkConnection" connectionString="Data Source=;User Id=;Password=;" providerName="Oracle.DataAccess.Client"/>
</connectionStrings>
<appSettings>
<!-- example: <add key="FrameworkSchema" value="GRB_FRAMEWORK_2" /> -->
<add key="FrameworkSchema" value="" />
<!-- example: <add key="AssistSchema" value="GRB_ASSIST_2" /> -->
<add key="AssistSchema" value="" />
<add key="FromEmail" value="support@myagency.com" />
<add key="PasswordCreateEmailSubject" value="GRB Assist Create Password" />
<add key="PasswordEstablishOrChangeEmailSubject" value="GRB Assist Established or Changed Password" />
<add key="PasswordForgotEmailSubject" value="GRB Assist Forgot Password" />
<add key="Timeout" value="60" />
<add key="RequiresSsl" value="False"/>
<!-- Email digital signing Pfx (certificate) -->
<add key="EmailSigningSignUsingCertificateFromPersonalStore" value="False" />
<add key="EmailSigningPfxFilePathAndName" value="" />
<add key="EmailSigningPfxPassword" value="" />
</appSettings>
<system.web>
<customErrors mode="Off"/>
<pages>
<controls>
<add tagPrefix="aspajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</controls>
<tagMapping>
</tagMapping>
</pages>
<!--

Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development.

-->
<compilation defaultLanguage="vb" debug="false">
<assemblies>
</assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
<!-- 1 GB maxRequestLength -->
<httpRuntime maxRequestLength="1048576" />
<sessionState mode="InProc" timeout="60" />
<!-- note: Set authentication timeout >= session timeout (session timeout will clear authentication timeout upon session_start) -->
<!-- note: <forms name="xxxx" value must be unique for each "forms authenticated" web application run on an IIS web server -->
<!-- note: For a more secure system, set requiresSSL="true" (and install/setup an SSL key on the web site) -->
<authentication mode="Forms">
<forms loginUrl="TimedOut.aspx" slidingExpiration="false" requireSSL="false" timeout="60"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<membership defaultProvider="FrameworkMembershipProvider1" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
name="FrameworkMembershipProvider1"
type="Grb.Security.FrameworkMembershipProvider"
applicationName="Product1"
passwordRetrieval="false"
passwordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="true"
passwordFormat="Hashed"
minRequiredNonalphanumericCharacters="0"
minRequiredPasswordLength="4"
passwordStrengthRegularExpression="^[a-zA-Z0-9]+$"
passwordStrengthFailedMessage="The password must be only alpha-numeric characters."
frameworkDomainName="Master"
maximumInvalidPasswordAttempts="3"
maximumInvalidPasswordAttemptLockoutMinutes="30"/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="FrameworkRoleProvider1">
<providers>
<clear />
<add name="FrameworkRoleProvider1"
type="Grb.Security.FrameworkRoleProvider"
applicationName="MyApplication1" />
</providers>
</roleManager>
</system.web>
<system.web.extensions>
<scripting>
<webServices>
<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
<!--
<jsonSerialization maxJsonLength="500">
<converters>
<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
</jsonSerialization>
-->
<!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
<!--
<authenticationService enabled="true" requireSSL = "true|false"/>
-->
<!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and writeAccessProperties attributes. -->
<!--
<profileService enabled="true"
readAccessProperties="propertyname1,propertyname2"
writeAccessProperties="propertyname1,propertyname2" />
-->
</webServices>
<!--
<scriptResourceHandler enableCompression="true" enableCaching="true" />
-->
</scripting>
</system.web.extensions>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
<location path="Default.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Portal.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Login.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="PasswordChange.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="PasswordForgot.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="PasswordEntry.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<!-- Give ControlLoader.aspx full access and let it check session/authentication validation.

The rational is that if a user is "timed-out" and presses a button to load a control into ControlLoader, the ControlLoader validation will catch this condition and tell the parent page to reload (so the Login page doesn't appear in the modal-dialog).

-->
<location path="ControlLoader.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Documents/AccountServices.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Documents/TermsOfUse.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="SystemAlertService.asmx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.net>
<mailSettings>
<smtp from="[URL]">
<!-- example: host="[URL]-->
<network
host=""
port="25"
defaultCredentials="true" />
</smtp>
</mailSettings>
</system.net>
</configuration>

View 1 Replies

Security :: Built-in Membership Framework And Has Implemented Own Provider By Creating A Class That Inherits From MembershipProvider?

Jan 23, 2011

used the built-in Membership framework and has implemented his own provider by creating a class that inherits from MembershipProvider (found in System.Web.Security). I actually went ahead and created a custom provider which inherits from MembershipProvider. The problem is that there are several methods I do not really need. Also, the schema is totally different. Plus, most methods return a MembershipUser which means my User class has to inherit from it as well. So really, what benefits does the MembershipProvider and the whole Membership framework add to my system? Do these benefits justify the fact that I won't be using most of the methods on the class?

View 7 Replies

Roleprovider - .NET User/Role Management In VS2010 - Skipping Over The SQL Express Version And Going Straight To SQL Server 2008 R2

Jan 28, 2011

As I'm learning the ins and outs of ASP.NET user management, I've learned that the default in VS is for it to use a SQL Server Express .mdf file for the data it needs to save. This won't help me for when I deploy my site, as I'm running SQL Server 2008 R2 on my IIS 7.5 server. I know that I can run a command line tool to automatically create the db tables necessary for user management, and will do that on my development machine, but how do I tell my existing, in development code in VS to ignore the existing Express .mdf file and look at the newly created db tables?

View 1 Replies

Security :: Web Farm Using Window Authentication Or Form Authentication?

Aug 9, 2010

I have a web farm web project, and want to make sure windows authentication is working well without any problem in web farm, can any one give me some web sites or information about that?

View 1 Replies

Security :: Can't Load Custom MembershipProvider From Web.config, "Input String Was Not In A Correct Format"

Jun 19, 2010

I'm facing very odd problem with my application. I've been developing my own custom memberhip provider (derived from MembershipProvider, of course) and everything was working smoothly, until something odd happened. In my config file, I register my provider with such code:

[Code]....

When I deploy my site, I get this error message:

Configuration Error

Description:

An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Input string was not in a correct format.

Source Error:

Line 62: <clear/>
Line 63: <add name="CustomSqlMembershipProvider"
Line 64: type="My_Membership.CustomSqlMembershipProvider"
Line 65: applicationName="My Application"
Line 66: enablePasswordRetrieval="false"

View 6 Replies

Architecture :: Distributed Caching / Keeping Cache In Sync Between Multiple Webservers Or Even Better Farm Cache Management To Another Server?

Feb 26, 2010

I've got a web application that runs of a state server. It looks like soon it may need to distributed and there will be two web servers behind a load balancer.

This works great for session state but my next challenge is Cache

My application leverages heavily of cache. I understand ASP.Net 4.0 will be offering more here but nothing much has been said about the how too.

There are two challenges that I face

1). Each webserver will have its own copy of cache whereas it would be more efficient to put this to a third server the same as session state is put to state server.

2). The real challenge is keeping cache in sync if a simple dataset derived from the database is changed my code dumps that cache item and reloads the cache. That's all well on one webserver but webserver number two wont know to drop that particular cache item and reload it. This could cause some unexpected problems in the application.

For scenario number 2 I could attempt to do some smart coding so server number two knows to dump the cache and reload it.

My guess is someone else has already been here before and there's probably a better implementation approach rather than writing extra code.

Does anyone know how I could achieve the goal of keeping Cache in sync between multiple webservers or even better farm Cache management to another server?

View 2 Replies

Security :: Not Extending MembershipProvider Class And Putting All This Methods In Some Unique Class And Call Its Methods Then?

Sep 16, 2010

I am beginner in web applications development. I started one little project and host it on source forge "https://homoco.svn.sourceforge.net/svnroot/homoco". And I started implementing authentication in this application to learn how it works. From my experience people never use out of the box things so I want to implement this stuff alone (like in real world projects). So some questions:

1) Is there any reason to use membership out of the box? To use database table schema, stored procedures etc. that tool generate for developer. I think that this lower control over code and I decided to implement it my self. I don't know if I am right.

2) Is my approach in this demo project good or bad (if someone have time I like to do just a little code review)? I created database based on business rules. Not using database schema that membership provider require. Extend "MembershipProvider" class to satisfy my needs. Implement queries to database myself.

3) Now, this question is a little wired but I have to ask it. If we make custom Membership Provider and do sql queries alone, implement all MembershipProvider class methods ourselves, and in application use Membership.blabla() why is this approach different from not extending MembershipProvider class and putting all this methods in some unique class and call its methods then? I hope that someone understand what I ask here.

I am sorry for three questions, but I really trying to find the best way to implement this feature in my demo project like it is a real world application.

View 3 Replies

Extending RoleProvider GetRolesForUser ()

Jun 3, 2010

The GetRolesForUser() method in the RoleProvider takes the user login name and returns the list of roles for that user. But in my application this is not enough, I need a few more pieces of information to be able to get the user's roles. How can I get this extra information into the method? I have it in the Session, but I found out that Session is not available in the RoleProvider.

What I had in mind was putting this extra info in some class that extends MembershipUser, assuming I can get to it inside the RoleProvider. But I don't know how to create the CustomMembershipUser and make it part of the MembershipProvider. Is this even possible? The easy way out would be using cookies, but I'm trying to keep away from it.

View 1 Replies

C# - Want To Create A Custom Roleprovider Through A WCF Service?

May 17, 2010

I have a web application that accesses a database through a wcf service. The idea is to abstract the data from the web application using the wcf service. All that works fine but I am also using the built in roleprovider using the SqlRoleManager which does access the aspnetdb database directly. I would like to abstract the roleprovider by creating a custom roleprovider in a wcf service and then accessing it through the wcf service.

I have created the custom role provider and it works fine but now I need to place it in a wcf service. So before I jump headlong into trying to get this to work through the WCF service, I created a second class in the web application that accessed the roleprovider class and changed my web config roleprovider parameters to use that class. So my roleprovider class is called, "UcfCstRoleProvider" and my web.config looks like this:

<roleManager
enabled="true"
defaultProvider="UcfCstRoleProvider">[code]....

But I get this error."Provider must implement the class 'System.Web.Security.RoleProvider'."

I hope I have explained well enough to show what I am trying to do. If I can get the roleprovider to work through another class in the same application, I am sure it will work through the WCF service but how do I get past this error?Or maybe I took a wrong turn and there is a better way to do what I want to do??

View 3 Replies

Custom RoleProvider Error - Using Article To Learn

May 10, 2010

I'm trying to use this article to learn about custom roleproviders, but I'm getting this error:

Could not load type 'TestRoles.SimpleRoleProvider'.

The relevant section from my web.config:

<roleManager enabled="true" defaultProvider="SimpleRoleProvider">
<providers>
<add name="SimpleRoleProvider" type="TestRoles.SimpleRoleProvider"/>
</providers>
</roleManager>

The RolesProvider.cs class:

public class TestRoles{
public class SimpleRoleProvider : RoleProvider
{
public override string[] GetRolesForUser(string username)
{
List<string> roles = new List<string>();
roles.Add("Guest");
if (username.Equals("Dave"))
roles.Add("Admin");
return roles.ToArray();
}
}
}

From this error, it seems like it can't find the RoleProvider.

View 1 Replies

Hierarchical SQL Roles Based On Default RoleProvider

Feb 11, 2011

I'm trying to implement the following adjustments to the default ASP.NET RoleProvider so that it supports hierarchical role definitions. However i cannot create the following function, it keeps Executing the function.

Ref: [URL]

What is wrong with this function?

-- Template generated from Template Explorer using:
-- Create Multi-Statement Function (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the function.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
CREATE FUNCTION [dbo].[aspnet_Roles_Ancestor_TVF] (
@RoleId uniqueidentifier
)
RETURNS
@aspnet_Roles TABLE (
ApplicationId uniqueidentifier
, RoleId uniqueidentifier
, RoleName nvarchar(256)
, LoweredRoleName nvarchar(256)
, Description nvarchar(256)
, ParentRoleId uniqueidentifier
)
AS
BEGIN
; WITH aspnet_Roles_CTE (
ApplicationId
, RoleId
, RoleName
, LoweredRoleName
, Description
, ParentRoleId
, HierarchyLevel
) AS (

[Code.....]

View 2 Replies

C# - Custom RoleProvider Not Working When Deployed To Web Apps Bin Directory?

Apr 4, 2011

I have created custom membership and role providers for a SharePoint web application.

If I deploy the DLL for these classes into the GAC, the membership/role provision works just fine. If I deploy these DLLs to the web application's bin folder in IIS, the web app bails with a server error immediately when browsing to the site.

Parser Error Message: Exception has been thrown by the target of an invocation.

If I view source on the error page I get a bit more info:

[code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved