2

My client has a database (TS) for a project I'm working on. This database has a Stored Procedure called Logon. Within that SPROC is a call to a second database (RRA), which is their custom authentication DB that is used across all of their projects. The result of this call is the Role(s) a user is assigned to (assuming authentication passes, of course).

I'm attempting to do this via WCF RIA Services. When I create my ADO.NET Entity Data Model, I'm not sure which Data connection I should use - the one that connects to TS, or the one that connects to RRA. I'm going on the assumption that its TS.

Beyond that assumption, I'm still stuck. I know I can add an Import Function to that Logon SPROC. Where do I go from here?

Scott Silvi
  • 3,059
  • 5
  • 40
  • 63

1 Answers1

1

I agree that you should target the TS database.

Here's a walkthrough of using stored procs.

http://www.robbagby.com/entity-framework/entity-framework-modeling-select-stored-procedures/

And here's an answer to how you can create a custom authentication using RIA Services.

RIA Services: How can I create custom authentication?

Community
  • 1
  • 1
Joe McBride
  • 3,789
  • 2
  • 34
  • 38
  • So my issue with targeting the TS database is that it doesn't actually hold the user information. That's ALL stored in the RRA table. The TS database is simply the one that has the stored proc that calls RRA & returns a userRole if the creds passed in authenticate. So, since I don't have a Users table to include in my model, nor do I have a Roles table, I have nothing to map my SPROC to. – Scott Silvi Feb 09 '11 at 01:35
  • 1
    Do you need more user information than just the user name and roles? Will you need to alter that user information? If so, then target the RRA database. The RIA Services Authentication service is completely separate from the main RIA domain service, so you shouldn't have any issues there. – Joe McBride Feb 09 '11 at 01:39
  • Can you elaborate on that some more? Do I create two Entities? One for the RRA for authentication then one for TS for my DomainService & eventual DomainContext ? I have a table in RRA named UserRole which contains email (FK)/RoleID (FK), then another table named Users with Email as PK, and finally a third table named WebRole with RoleID as PK. I'm not sure which table I should map my return value to. If I don't have an entity in my model, when I go to set up my domainservice, I have no data context to bind it to. – Scott Silvi Feb 09 '11 at 01:49