views:

77

answers:

1

I've been trying to solve a problem that I really hope someone can help with, or at least point me in the right direction. I've been googling on this for days and just can't quite come up with the answer.

Background:

I'm using RIA Services to handle communication, validation, etc...from a Silverlight 4 app. I have two domains services, the typical one for Authentication and then one for my business logic. For authentication/authorization I'm using .NET Membership (forms authentication is enabled) which is a typical scenario when using RIA Services.

Problem: What I would like to be able to do is call one of the services from the other one and have the target service know which user is logged in. So, for instance, call from the business domain service into the authentication domain service and have it know who the authenticated user is. This works fine when I call from the client (SL app) to either one of the services, so RIA Services is handling that plumbing, but I can't get the "inter-service" authorization to work. Each of my domain services have a WCF reference (SOAP) to the other service and the actual calls work fine, it's just that the target service does not know of the authenticated user.

A scenario: Client calls to the business domain service (service knows of authenticated user) Business domain service calls to the authentication domain service (authenticated user is NOT recognized)

So, any help on this would be really appreciated. I'm driving myself nuts trying to figure this out. I can't but think it may be something rather simple I am missing...

Thanks everyone!

A: 

Hi I suppose it's a little late for your question, but I bumped into this and so I'll give you my take anyway : you can use the ServiceContext.User property in your business domain service to access the current User.

Yacine Khammal