locked
Reportviewer authentication RRS feed

  • Question

  • Hi!

    I cant find any tutorials how to set up authentication on my report page.

    I am building lightswitch silverlight web application which has additional aspx forms page which holds report viewer. I was wandering is it possible to check if user is loged in main silverlight application before displaying the report page?

    Wednesday, January 8, 2014 10:21 AM

Answers

  • Hey,

    not sure if you can share authentication between SL client and a server page.  

    I would love to know myself.  As a workaround, this piece of code

    if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
    {
      Response.Redirect("~/login.aspx?ReturnUrl=%2fReportViewer.aspx");
    }

    will require your users to enter their credentials so at least your page won't be publicly visible.

    They can check 'remember me' to avoid having to enter credentials each time.

    You can edit the server's login.aspx page and change the log-in message too.

    Keep rocking LS


    Jan


    It's your story - time to switch on the innovation.||About me||LightSwitch blog

    • Marked as answer by Angie Xu Wednesday, January 15, 2014 6:57 AM
    Friday, January 10, 2014 3:10 PM
  • Hi Jan!

    Thank you for your help! It is exactly what i need. So this is working for me

    if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/default.htm");
            }

    • Marked as answer by Angie Xu Tuesday, January 21, 2014 8:29 AM
    Tuesday, January 21, 2014 8:28 AM

All replies

  • Hi DarioOs

    >how to set up authentication on my report page.

    For this issue, it seems that another login is required for the reports when the Forms Authentication is used in your lightswitch application. Here are some hints for you - Reporting within lightswitch web application

    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.

    Friday, January 10, 2014 7:58 AM
  • Hey,

    not sure if you can share authentication between SL client and a server page.  

    I would love to know myself.  As a workaround, this piece of code

    if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
    {
      Response.Redirect("~/login.aspx?ReturnUrl=%2fReportViewer.aspx");
    }

    will require your users to enter their credentials so at least your page won't be publicly visible.

    They can check 'remember me' to avoid having to enter credentials each time.

    You can edit the server's login.aspx page and change the log-in message too.

    Keep rocking LS


    Jan


    It's your story - time to switch on the innovation.||About me||LightSwitch blog

    • Marked as answer by Angie Xu Wednesday, January 15, 2014 6:57 AM
    Friday, January 10, 2014 3:10 PM
  • Hi Jan!

    Thank you for your help! It is exactly what i need. So this is working for me

    if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/default.htm");
            }

    • Marked as answer by Angie Xu Tuesday, January 21, 2014 8:29 AM
    Tuesday, January 21, 2014 8:28 AM