views:

29

answers:

2

Hi

On my current project, i need to have a login/logout and some authorization in order to let certain users from different companies access different View screen on the silverlight application. And do some operation on it

Can you tell me where i can find the information for authentication/authorization by using RIA service with silverlight 4?

---Things i need to be able to do---

1.Restrict certain actions to certain users ( such as Delete/Insert/Update data in a datagrid)

2.Restrict to access certain page/view by showing a dialog message.

  1. Setting default value for current accessed user if they want to fill out some dataform

Any guidance will be appreciated.

+1  A: 

Not sure I can give an exact answer but I can point you in the right direction.

When you create a RIA project it will automatically create an authentication service (WCF Service) in your IIS project. This contains the methods used from your Silverlight client in order to login and logout a user. The authentication service that is created will by default use the membership provider from ASP.NET. So if you need to customize how users are validated then you need to create your own custom membership provider and override the logic for validating user credentials. Checking it against your own database(s) instead of the standard mechanism provided out of the box.

From the Silverlight side, you will see a class automatically created with user details. You need to use this when deciding if the currently logged in user can perform any specific action. You can add extra fields to this structure by adding them into the web project definition and then updating the Silverlight project references.

Phil Wright
+1  A: 

Try this link: http://msdn.microsoft.com/en-us/library/ee942449(VS.91).aspx

It will give you an overview of the authentication service in Silverlight plus it will tell you how to handle the access restrictions you are looking for on the database calls. It is a manual process but it gives you alot of control over your data access.

Varuuknahl