kentico_ivanat wrote: Hi,
you need to authenticate user using
API in the file:
\CMSDesk\Header.aspx.csThere is an event handler SiteSelector_OnSelectionChanged, where you need to place the code.
I've looked into this in more detail and tried switching from 'my.website.com.au/site1' to 'my.website.com'.
The problem originates from line 298 in '\CMSDesk\Header.aspx.cs':
url = URLHelper.GetAbsoluteUrl(url, domain, null, null);
The GetAbsoluteUrl does not appear to resolve the URL properly from the given parameters. It's a compiled library, so I cannot see it's source. However, the supplied parameters are as follows:
url: '~/CMSDesk/Default.aspx'
domain: 'my.website.com'
This *should* resolve to 'http://my.website.com/CMSDesk/Default.aspx'.
But it doesn't. Instead, it resolves to 'http://my.website.com/site1/CMSDesk/Default.aspx'
It looks like URLHelper.GetAbsoluteUrl() is using the current website's setup to generate absolute paths, when it *should* be using the target website's setup to generate absolute paths (in case the target website is a virtual application or root application).
I have modified the SiteSelector_OnSelectionChanged() code to the following:
url = url.StartsWith("~") ? domain + url.Substring(1) : domain + url;
if (!URLHelper.ContainsProtocol(url))
url = "http://" + url;
Unfortunately, this will get overwritten every time I perform a site upgrade. Can you suggest any workarounds to this?
Also, can you foresee any problems with the replacement code?