Beta1 BUG: Forms authentication prevents access to the PageMethods proxy

Last post 12-19-2006 4:32 PM by jlchereau. 6 replies.

Sort Posts:

  • Beta1 BUG: Forms authentication prevents access to the PageMethods proxy

    10-24-2006, 3:20 AM
    • Member
      91 point Member
    • jlchereau
    • Member since 03-21-2006, 12:07 PM
    • Posts 25

    I am currently migrating my code from July CTP to Beta 1

    I have a PageMethod in my forms autentication login page. It is used in the reset password section or the page to display the question corresponding to the email address that the user enters.

    This used to work in July CTP and it is broken in Beta 1 because the forms autentication prevents access to teh PageMethods proxy.

    Actually, calling http://localhost/login.aspx/js is redirected to http://localhost/login.aspx?ReturnUrl=%2flogin.aspx%2fjs

    Is this a bug or by design?

  • Re: Beta1 BUG: Forms authentication prevents access to the PageMethods proxy

    10-24-2006, 2:19 PM

    One change from the previous CTP is that PageMethods now have to be declared as "static".  Can you please double-check to make sure this is not the problem?  If your authentication allows you to access login.aspx, then the page methods that live on login.aspx should also be accessible.  If they are still not after you made them static, can you please post a small code sample?

    Unlike the .asmx pages, login.aspx/js will not return you the proxy.  The proxy for PageMethods will always be inlined on the page.

    Thanks,



    Leonid



    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Beta1 BUG: Forms authentication prevents access to the PageMethods proxy

    12-06-2006, 9:50 AM
    Answer
    • Member
      91 point Member
    • jlchereau
    • Member since 03-21-2006, 12:07 PM
    • Posts 25

    I have identified the problem. My PageMethod was decorated with both

    [System.Web.Services.WebMethod]

    [Microsoft.Web.Script.Services.ScriptMethod]

    Removing WebMethod solved the issue.

  • Re: Beta1 BUG: Forms authentication prevents access to the PageMethods proxy

    12-06-2006, 1:32 PM

    This behavior does not make sense to me - having WebMethod should not break anything, in fact it is required.  ScriptMethod, on the other hand, is optional, and is used mostly to provide options like [ScriptMethod(UseHttpGet=true)]

     Can you please give us an example of what your method signature looks like, including all the attributes?

    Thanks,



    Leonid



    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Beta1 BUG: Forms authentication prevents access to the PageMethods proxy

    12-06-2006, 1:32 PM

    This behavior does not make sense to me - having WebMethod should not break anything, in fact it is required.  ScriptMethod, on the other hand, is optional, and is used mostly to provide options like [ScriptMethod(UseHttpGet=true)]

     Can you please give us an example of what your method signature looks like, including all the attributes?

    Thanks,



    Leonid



    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Beta1 BUG: Forms authentication prevents access to the PageMethods proxy

    12-06-2006, 1:32 PM

    This behavior does not make sense to me - having WebMethod should not break anything, in fact it is required.  ScriptMethod, on the other hand, is optional, and is used mostly to provide options like [ScriptMethod(UseHttpGet=true)]

     Can you please give us an example of what your method signature looks like, including all the attributes?

    Thanks,



    Leonid



    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Beta1 BUG: Forms authentication prevents access to the PageMethods proxy

    12-19-2006, 4:32 PM
    • Member
      91 point Member
    • jlchereau
    • Member since 03-21-2006, 12:07 PM
    • Posts 25

    Leonid, thx for your interest.

    It is obviously not the WebMethod attribute although it did work once, but broke again on the following day.

    I have found the solutions to the problem.

    See: http://jlchereau.blogspot.com/2006/12/aspnet-ajax-page-method-on-login-page.html

Page 1 of 1 (7 items)