If you use a 3rd party service to connect to your Citrix Storefront environment, you may want to “pass-through” credentials without using domain authentication or whatever. This post illustrates how you can login to your Storefront environment using nothing more than a URL with your credentials embedded in them. To enable this functionality, this code must be in your custom.js file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
// CTXS.getParametersFromQueryString(window.location.search.substring(1)) //grab URL query parameters var username = CTXS.getParametersFromQueryString(window.location.search.substring(1)).username var password = CTXS.getParametersFromQueryString(window.location.search.substring(1)).password CTXS.Extensions.beforeLogon = function(callback) { if (username) { var a = "PostCredentialsAuth/Login"; $.ctxsAjax({ type: "POST", url: a, async: false, data: { username: username, password: password }, dataType: "json", suppressEvents: !0, refreshSession: !0 }) CTXS.Location.assign(CTXS.Location.origin + CTXS.Location.pathname); //remove URL query parameters } callback(); }; |
You MUST have HTTP Basic enabled as an authentication method on your Citrix Storefront Store.
The URL to login would look like this:
1 |
http://storefront.bottheory.local/Citrix/StoreWeb/?username=BOTTHEORY\ttye&password=C0mplexPAsswordHorseStaple |
Put it all together:
Thanks alot. very useful article.