This Forum is ARCHIVE only
For LightSwitch questions,
please use the official forums at:

http://social.msdn.microsoft.com/forums/en-US/lightswitch/threads


LightSwitch "OData Service" Date Source custom authentication
Last Post 25 Jul 2013 09:48 PM by admin. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
JevgenyUser is Offline
New Member
New Member
Send Private Message
Posts:2
Avatar

--
25 Jul 2013 04:18 AM

    Hello!

     

    I was killed a day to find out how to add to the LightSwtich 3 application with the "OData Service" datasource my Auth Cookie. I have a code, which is acquiring an authorization token to the System, exposing OData. And I Need to add this Cookie to all REST requests, which are produced by LightSwitch Framework. What is the most effective way to do this?

     

    I thougth-tried:

    * To find Extension Points of LightSwitch Framework (Like QueryInterceptors). But all I can find working on incoming queries (not outgoing)

    * To write some low-level plugin and to attach it to the IIS? Tried IHttpModule, but again seems it working only on incoming requests - outgoing Responses, but here http://msdn.microsoft.com/en-us/lib...x#Features is stated "HTTP modules let you examine incoming and outgoing requests and take action based on the request." Can't find, how to make this.

     

    So, please, any advices are welcome, I am stuck

    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1313
    Avatar

    --
    25 Jul 2013 04:30 AM
    see:
    "OnSendingRequest(object sender, SendingRequestEventArgs e)"
    in :
    http://lightswitchhelpwebsite.com/B...-Code.aspx
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    JevgenyUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:2
    Avatar

    --
    25 Jul 2013 07:45 PM
    Hello Michael,

    Thank you for your reply. I've seen this article found as one of the first. That's exactly how it should look like in my case (I imagine) but! I feel there is a difference in what you described in this article and what I want to achieve.
    I also have read source article in the beginning of yesterday. All these articles are about securing OData endpoint, provided by LightSwitch. I don't need any security for that. I need to let LightSwitch to consume protected OData endpoint and then to expose it as protected/unprotected, doesn't matter. Referenced article has WCF Data source, and it's a different data story. There I could use behaviours, Query interceptors and so forth. 

    Just example: imagine you have org in CRM Online, or Sharepoint Online. And you need to access to the exposed REST service. You create new Data Source: "OData Service" in LightSwitch provide uri and credentials... Nothing will happen, because LS can't work with ADFS. You need to authenticate other way and get cookie for the session, like here: http://bingsoft.wordpress.com/2013/...-and-adfs/
    And then add this cookie to all OUTGOING REST requests, generated by LS libraries. So the question is - how to add this cookie to generated OData requests. 
    BTW OnContextCreated() and this.SendingRequest dont exists for LS OData dataContext... 
    Please, any help appreciated!
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1313
    Avatar

    --
    25 Jul 2013 09:48 PM
    Sorry I am not familiar with that particular situation.
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    You are not authorized to post a reply.


    Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation