ASP.NET is not authorized to access the requested resource

Discussion in 'ASP.NET / ASP.NET Core' started by dhamenha, Feb 28, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. my application hosted in discountasp and I am trying to run this page "http://www.saudiarrows.com/_dload/frmddp.aspx" and i am getting the below error message,
    any idea what this error could be?

    I am trying to Load Remote Web page into my website, code and error is below:


    This this code:



    Private Function getRemotePage(ByVal sURL As String) As String





    Dim objMSHTML As New mshtml.HTMLDocument
    Dim objMSHTML2 As mshtml.IHTMLDocument2
    Dim objMSHTML3 As mshtml.IHTMLDocument3
    Dim x As Integer = 10





    Try


    Dim objIPS As IPersistStreamInit

    objIPS = DirectCast(objMSHTML, IPersistStreamInit)


    objIPS.InitNew()
    objMSHTML2 = objMSHTML.createDocumentFromUrl(sURL, vbNullString)


    Do Until objMSHTML2.readyState = "complete"


    x += 1


    ' Application.DoEvents() 'Suggested by John


    Loop


    objMSHTML3 = DirectCast(objMSHTML2, mshtml.IHTMLDocument3)
    Dim sBody As String = ""
    sBody = (objMSHTML3.body.outerHTML).ToString()
    sBody = sBody.Replace("<SCRIPT>", "")
    sBody = sBody.Replace("<SCRIPT ", "")
    sBody = sBody.Replace("</SCRIPT>", "")
    sBody = sBody.Replace("<script ", "")
    sBody = sBody.Replace("</script>", "")


    Return sBody


    Catch ex As Exception


    Return ex.Source


    End Try


    End Function


    <ComVisible(True), ComImport(), Guid("7FD52380-4E07-101B-AE2D-08002B2EC713"), _
    InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _


    Public Interface IPersistStreamInit : Inherits IPersist
    Shadows Sub GetClassID(ByRef pClassID As Guid)
    <PreserveSig()> Function IsDirty() As Integer
    <PreserveSig()> Function Load(ByVal pstm As UCOMIStream) As HRESULT
    <PreserveSig()> Function Save(ByVal pstm As UCOMIStream, _
    <MarshalAs(UnmanagedType.Bool)> ByVal fClearDirty As Boolean) As HRESULT
    <PreserveSig()> Function GetSizeMax(<InAttribute(), Out(), _
    MarshalAs(UnmanagedType.U8)> ByRef pcbSize As Long) As HRESULT
    <PreserveSig()> Function InitNew() As HRESULT


    End Interface


    <ComVisible(True), ComImport(), Guid("0000010c-0000-0000-C000-000000000046"), _
    InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _


    Public Interface IPersist


    Sub GetClassID(ByRef pClassID As Guid)
    End Interface



    Declare Function CreateStreamOnHGlobal Lib "ole32" (ByVal hGlobal As IntPtr, ByVal fDeleteOnRelease As Boolean, _
    ByRef ppstm As UCOMIStream) As Long


    Public Enum HRESULT


    S_OK = 0
    S_FALSE = 1
    E_NOTIMPL = &amp;H80004001
    E_INVALIDARG = &amp;H80070057
    E_NOINTERFACE = &amp;H80004002
    E_FAIL = &amp;H80004005
    E_UNEXPECTED = &amp;H8000FFFF


    End Enum

    This is the error message:


    Exception Details: System.UnauthorizedAccessException: Access is denied.

    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.



    Any help is appreciated
    </o:p>
    Thank you</o:p>
    </o:p>

    Post Edited (dhamenha) : 2/28/2006 6:39:14 PM GMT
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    it looks like your application is trying to access a COM object that users do not have permission over. have you created a support ticket?

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Bruce

    Bruce DiscountASP.NET Staff

  4. in addition to security, there are serious performance and scalability issues that affect the entire server.


    Joel Thoms

    DiscountASP.NET
    http://www.DiscountASP.NET
     
  5. Do you suggest any other DLL to use so I don?t spent two weeks of my time then later I discover it is prohibited as well?

    Thanks for your understanding
    Dhamenha
     
  6. Thank you Joel, that is helpfull to me.

    Regards,
    Dhamenha
     
  7. this is their responed below.






    Dear Customer,

    Your application is trying to access the MSHTML.dll (one of the IE core DLL), which we do not allow access to due to security reasons. Because of security issues with Internet Explorer, we generally prohibit rendering with IE, which iswhat mshtml does. You will have to use another dll instead of this one as a workaround.

    Thank you

    DiscountASP.NET
    The power of ASP.NET for less
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page