How to use GetXmlDocumentByUrl() with authentication
Hi all - I have a small problem using the GetXmlDocumentByUrl() extension in umbraco.library.
I've used Public Access to lock down the site, but one of the macros that render the meat of the page is using GetXmlDocumentByUrl(), fetching a document inside the site — but as it turns out, this request is not authenticated (so instead of an XML document, the HTML document with the Login screen is returned).
Is there a way around this, or do I need to write my own extension that specifically handles this?
Anyone else got an idea? (My Plan B is to have the request go "outside" of the protected section of the site and then link them using a token of some sorts...
How to use GetXmlDocumentByUrl() with authentication
Hi all - I have a small problem using the
GetXmlDocumentByUrl()
extension inumbraco.library
.I've used Public Access to lock down the site, but one of the macros that render the meat of the page is using
GetXmlDocumentByUrl()
, fetching a document inside the site — but as it turns out, this request is not authenticated (so instead of an XML document, the HTML document with the Login screen is returned).Is there a way around this, or do I need to write my own extension that specifically handles this?
/Chriztian
Unfortunately the
GetXmlDocumentByUrl()
method is very naive, so it doesn't know anything about how to authenticate. I think copying the method and adding the currently existing cookies like this might work: http://stackoverflow.com/questions/5443667/httpwebrequest-pass-credentials-to-next-httpwebrequestThanks Sebastiaan,
Sounds like it could do the trick -- I'll give it a go!
/Chriztian
Sad Panda :(
Can't get it to work...
I'm doing this (thanks to @k_h_schneider):
The request still gets sent to the login page.
Anyone else got an idea? (My Plan B is to have the request go "outside" of the protected section of the site and then link them using a token of some sorts...
/Chriztian
is working on a reply...