This is a migrated thread and some comments may be shown as answers.

Javascript error when adding Authorization code block to web.config

1 Answer 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 2
Doug asked on 30 Jul 2015, 02:48 PM

I have added Forms authentication to my Telerik Website which is working fine.  When I add the code block for <authorization> the side will load but throw the following error before opening the login page:

 

JavaScript critical error at line 3, column 1 in http://localhost:61573/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:88fd0407-24cf-4abd-9df5-22f81b2bc835:ea597d4b:b25378d2;Telerik.Web.UI:en-US:33628d01-7007-4010-a8f6-f8f356bdff24:16e4e7cd:f7645509:22a6274a\n\nSCRIPT1002: Syntax error

 

If I remove the code block the site works but there is complete access to all the pages.

    <authorization>
      <deny users="?" />
    </authorization>

 

Not sure where to start looking.  I don't really want to create a session variable and redirect to the login page if not set if I don't have to.

 

This is a VS 2013 / .net framework 4.5 / C# web application.

 

Any thoughts?

 

Doug

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 04 Aug 2015, 02:22 PM
Hello,

You can use the bellow web.config configuration to exclude Telerik.Web.UI.WebResource.axd from authentication:
<location path="Telerik.Web.UI.WebResource.axd"
    <system.web>     
        <authorization>
            <allow users="*" />     
        </authorization
    </system.web>
</location>

Give it a try and let me know if this helps to prevent the javascript error.

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Doug
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Share this question
or