0
votes

Current 2-tier application

ASP.NET (Membership/Roles) – BL – DAL – DB

After the user is authenticated (membership) we use roles to facilitate authorization to different menu items such as “Reporting” and “Administration”. However as part of authorization, we must also take into account response filtering. For example regardless of the user’s role, a method to retrieve a statement by id should be limited to the user being able to retrieve only the statements that belong to them via some established database relationship. To facilitate this, the web application maintains in session a profile (POCO) which is injected into each BL object (perhaps this object should have been incorporated into IIdentity). Subsequently inside BL we’re able to determine if the request for id X should indeed return a statement, because we know the user that is requesting this statement, and we know the relationship between the statement and the users that should be able to access it.

Future 3-tier application

ASP.NET (Membership/Roles) – WCF - BL – DAL – DB

Authentication seems to stay the same, the WCF service can be password secured to make sure that only our web application (or any other that has the user/password) has access to it. However how do I go about facilitating response filtering? Are there seamless mechanisms to pass ASP.NET’s IPrincipal/IIdentity to the service? If yes, how will this limit me if down the line I have a non-ASP.NET client to the same service? If not, should this information be part of the request dto or request header?

2

2 Answers

0
votes

You could apply XACML to your 3-tier application. You would have authorization in the widgets (menus, buttons...), the business logic, and the WCF tier.

All requests will go against the same authorization policy written outside in XACML. Your rules can say:

  • adminstrators can view the admin button
  • users can view statements they own (i.e. users can view a statement if statement.owner==user.id)

You no longer need to implement a database relationship. Your authorization becomes much easier.

HTH

0
votes

Re:

Are there seamless mechanisms to pass ASP.NET’s IPrincipal/IIdentity to the service?

you could look at WS-Trust: weblogs.asp.net/cibrax/archive/2006/09/08/SAML-2D00-STS-implementation-for-WCF.aspx