Re: Help with ASP.NET Memberships

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Kevin,

I'm swamped today but will read your entire message along with the links you posted.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Kevin Spencer" <unclechutney@xxxxxxxxxxxx> wrote in message news:uNdylf$DIHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
Hi Jonathan,

I understand your difficulty. When I had a similar project, I experienced the same thing. It took me a good bit of research and study to get the ideas behing the ASP.Net Provider Model, and some of the implementations of it (Membership Provider, Role Provider, SiteMap Provider) which come packaged in the framework, but once I "got it" it became fairly simple to use, and I even ended up writing a Provider of my own which I used for email with Memberships and Roles in an application.

Part of the confusion may arise from not understanding (as I did not) that several or all of these Providers may be mixed and matched. For example, in my project, I used all of them together. The difference between Membership and Roles is only one of specificity. If you think about how Windows security works, it is very similar. Membership is similar to individual users on a system or a domain. Roles are similar to Groups. As a user may be a member of several Groups, so Members may have many Roles. The link between these and the SiteMap Provider is that the SiteMap Provider includes support of restricting both the navigation viewability of sections or individual pages in a web site, and the ability to directly navigate to sections or pages in a web site, via the application of Roles and Members to those sections and pages, via Membership and/or Role Providers.

Another aspect which may cause confusion is that these are all designed to be highly flexible, and the documentation reflects this. It is not necessary to use both Membership and Roles, for example, One may use one or the other. In addition, the storage of Membership and Role data is highly configurable/flexible, allowing the developer to choose between using XML configuration files, databases, Windows security accounts, or any other storage mechanism desired. This is all accomplished via loose coupling between the provider classes and their backing data stores.

The simplicity comes from a combination of the Provider pattern itself, and the use of static classes to provide the interface between the application and the Provider. The Provider pattern dictates that a static class of static methods is the "intermediary" between the application and the actual Provider class implementation. The static class acts as a "proxy" for the implementation, accepting input from the application, passing it on to the Provider class implementation, getting the response from the implementation, and returning it to the Application transparently. The application knows nothing of the actual Provider implementation; the static class finds it via the configuration file.

It is the implementation that knows where the data store is, and how to handle the input. There are a very few built-in implementations in the Framework, but many which can be developed, if one understands the model. The application knows what to expect from the static class, and as long as it gets what it expects, it can use any Provider.

At any rate, some articles and sample code might be helpful to you (I know they were to me), so here are some good links:

http://www.odetocode.com/Articles/427.aspx
http://www.odetocode.com/Articles/428.aspx
http://msdn2.microsoft.com/en-us/library/aa479030.aspx
http://msdn2.microsoft.com/en-us/library/aa478948.aspx
http://msdn2.microsoft.com/en-us/library/aa479031.aspx
http://msdn2.microsoft.com/en-us/library/aa479032.aspx
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/security/default.aspx
http://msdn2.microsoft.com/en-us/asp.net/aa336558.aspx
http://msdn2.microsoft.com/en-us/library/ms998317.aspx
http://msdn2.microsoft.com/en-us/library/ms998347.aspx
http://msdn2.microsoft.com/en-us/library/ms998314.aspx

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net


"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message news:ePPUGD6DIHA.5856@xxxxxxxxxxxxxxxxxxxxxxx
Okay, thanks. It would be a shame though. In my database, some users are clients and some users are trainers and each client must be associated with a trainer. So if my data is in separate tables, I need a table just to link the users to trainers. In addition to the fact that I think that would break things like cascading deletes, etc., it just doesn't seem like a very good design.

It looks like you can implement your own provider class. I'll research that some more as I don't know if that's more than I want to get into now.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


"Scott M." <s-mar@xxxxxxxxxxxxx> wrote in message news:ONecSu4DIHA.3848@xxxxxxxxxxxxxxxxxxxxxxx
Correct. Also, I don't see any problem with creating relationships in your new table(s) with existing data. Also, I'm not sure what data (if any) in the auto-generated tables may be encrypted or hashed, so you may run into issues deciphering the data (I'm not sure).



"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message news:%23UQH883DIHA.748@xxxxxxxxxxxxxxxxxxxxxxx
I just want to make sure I understand.

So you don't see any need for a separate database, but that I should add separate tables for storing my application's user data, even if there is some overlap. Is that correct?

At this point, I should probably take the path of least resistance.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Scott M." <s-mar@xxxxxxxxxxxxx> wrote in message news:e0clM33DIHA.5160@xxxxxxxxxxxxxxxxxxxxxxx
Are you recommending I create a new database so that I have two different databases that store my users' data?

No, you could create new tables in the membership database if needed, but I wouldn't mess with any of the auto-generated stuff.










.



Relevant Pages

  • Re: Help with ASP.NET Memberships
    ... (Membership Provider, Role Provider, SiteMap Provider) ... The difference between Membership ... configuration files, databases, Windows security accounts, or any other ... The static class acts as a "proxy" for the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Defining Groups with AD users
    ... For ASP.NET authentication and role based authorization, ... you can configure the membership to use AD ... membership provider and Rolemanager to use SQL server provider. ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Defining Groups with AD users
    ... For ASP.NET authentication and role based authorization, ... you can configure the membership to use AD ... membership provider and Rolemanager to use SQL server provider. ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: MS ADAM: How strategic is a) MS ADAM and b) Authorizaion Manager?
    ... I'm not really sure on all of the details on the AD membership provider as I ... > I hadn't found ActiveDirectoryMembershipProvider in any of the TechEd ... I think the issue here is that AzMan is a much ...
    (microsoft.public.windows.server.active_directory)
  • Re: Replacing VS .NETs SQL Server Express Edition Integration
    ... You could write a custom membership provider. ... You could add the tables you need to your existing database table. ... As for configuring ASP.NET 2.0 membership to connect SQL Server 2000, ...
    (microsoft.public.dotnet.framework.aspnet)