locked
Can I connect a LightSwitch project to an external OData source that is secured with Basic (or any form of) Authentication RRS feed

  • Question

  • Hello,

    I've looked for other questions that seem related to this issue, but most responses seem to be made under the assumption that the user is attempting to access the service generated by LightSwitch.

    What if I want to connect my LightSwitch application to an external data source that requires some form of authentication? How can I send credentials to such a service?

    I've attempted to connect to a service that requires Basic authentication. I've used the "Attach Data Source Wizard" and entered the name of an OData source. I've specified the authentication type as "Other". What does this setting actually do? It does not seem to change the requests sent to the external source.

    Is it not possible to use LightSwitch with external sources that require Authentication of any kind?

    Thank you,

    Michael

    Friday, March 14, 2014 7:01 PM

Answers

  • Hi Michaelkdaw

    Appreciate your feedback.

    If you want to connect LightSwitch project to an external OData source that is secured with Windows/Form authentication, you need fill in authentication information when you connect to data via

    Attach Data Source Wizard -> Choose a Data Source Type.

    For further information: Connect LightSwitch to an Existing Database

    Best regards

    Angie Xu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Angie Xu Friday, March 21, 2014 1:11 AM
    Wednesday, March 19, 2014 8:57 AM

All replies

  • Hi Michael

    According to your description above,  you want to secure access to your application data via OData.

    You can turn on access control for LightSwitch applications using the project settings. LightSwitch supports three authentication settings: None, Forms, and Windows.

    When you select Forms, LightSwitch enables two modes of authentication. One is a custom protocol used by the LightSwitch clients Login dialog. This uses a custom web service API to pass credentials and obtain a forms-authentication cookie. If a request for data doesn’t have a valid forms-authentication cookie, LightSwitch will respond with an HTTP Basic challenge. This allows non-LightSwitch clients to pass credentials via a standard HTTP protocol.

    If you choose Windows authentication, LightSwitch will require an authenticated Windows user. This works great for in-house applications. LightSwitch doesn’t currently support this option for Azure-hosted services, although you can configure ADFS manually outside of LightSwitch.

    For relevant issues about securing LightSwitch OData, please refer to blog below.

    LightSwitch Architecture: OData (John Rivard)

    Best regards

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 17, 2014 11:15 AM
  • Hello Angie,

    I appreciate your response. However, I don't believe we are talking about the same thing. I believe you are referring to the OData feed created by Lightswitch. I understand that I can secure this feed with Forms authentication. I'm referring to credentials used to authenticate against the external data source, not the OData source created by Lightswitch.

    Monday, March 17, 2014 3:20 PM
  • Hi Michaelkdaw

    Appreciate your feedback.

    If you want to connect LightSwitch project to an external OData source that is secured with Windows/Form authentication, you need fill in authentication information when you connect to data via

    Attach Data Source Wizard -> Choose a Data Source Type.

    For further information: Connect LightSwitch to an Existing Database

    Best regards

    Angie Xu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Angie Xu Friday, March 21, 2014 1:11 AM
    Wednesday, March 19, 2014 8:57 AM