Getting client side variables passed to IAuthorizeDataPortal.Authorize method

Getting client side variables passed to IAuthorizeDataPortal.Authorize method

Old forum URL: forums.lhotka.net/forums/t/11072.aspx


wesa posted on Thursday, January 19, 2012

Hi, I was hoping someone could help me with a problem I'm trying to solve.

I'm setting up a WCF security application to run on our application server that will be used to verify client data portal requests. I have the application running and the client side data portal fetch triggers the IAuthorizeDataPortal.Authorize method that I have implemented. The issue is that I need to get a specific variable from the data portal request and the client's active directory username to verify that they have the proper access rights for the data.

I know that three objects are passed into the Authorize method: ObjectType, RequestObject and DataPortalOperation. I am just at a loss at how to retrieve the variable from the object(s).

 

Thanks!

wesa replied on Thursday, January 19, 2012

I should have also said that I am using CSLA.NET 4.0 and VB.NET.

JonnyBee replied on Thursday, January 19, 2012

Hi
  ApplicationContext.ClientContext  
  ApplicationContex.CGlobalContext

        if (ApplicationContext.AuthenticationType != "Windows")         
            ApplicationContext.User = request.Principal;    

is set by the DataPortal before AuthorizeRequest is called.

So any context values set on the client in ClientContext and GlobalContext + the user principal when not WindowsPrincipal is set and available for use in the AuthorizeRequest implmenetation.

Copyright (c) Marimer LLC