DotNetNuke : How to do single sing-on to multiple portals - cookies

I have a Dotnetnuke environment with multiple portals running at different subdomains (serviceA.company.com, serviceB.company.com). I can allow users the access to each portal by adding rows to UserPortals table, but since DNN uses full domain name in the auth cookie, the users need to log separately to each portal.
I'd like to have the system working so, that you only need to log in once on some of the portals, and wouldn't have to log in on the others. Is this possible?

This is possible by changing the web.config.
It's been a while since I did this, but I think you need to change the following
<httpCookies httpOnlyCookies="true" requireSSL="false" domain="" />
to
<httpCookies httpOnlyCookies="true" requireSSL="false" domain="*.company.com" />
I might be off on the setting, but there is a way to do this in the web.config. Let me know if that works.

Related

Liferay and <portlet:renderURL> to a friendly URL

I have created a page with a friendly URL of /balance-inquiries. The full URL given within the Liferay Admin's Site Pages page is http://localhost:8080/group/guest/balance-inquiries.
Creating a renderUrl (or an actionUrl) to this page, from another page is proving to be a bit frustrating. Below is one of many variations I have tried to get this working.
<portlet:renderURL var="searchTransactionsUrl">
<portlet:param name="mvcPath" value="/balance-inquiries" />
</portlet:renderURL>
Search LPC Transactions
My question is what param values should I use to make this link work? Or should I resort to a redirect, or using instead?
Thanks in advance.
I've figured out how to build dynamic URLs for portlets spanning different WAR files. The code is as follows:
<portlet:defineObjects />
<liferay-theme:defineObjects />
<%
String portletId = "giftcardtransactionfilesummary_WAR_myportalgiftcardportlet";
long otherPlid = PortalUtil.getPlidFromPortletId(themeDisplay.getScopeGroupId(), portletId);
%>
<liferay-portlet:renderURL var="giftcardTransactionFileSummaryUrl" plid="<%=otherPlid%>" portletName="<%=portletId%>">
<liferay-portlet:param name="groupId" value="10157" />
<liferay-portlet:param name="articleId" value="11385" />
</liferay-portlet:renderURL>
view giftcard batch files
The tricks are as follows:
Understanding the naming convention behind Liferay-generated
portletIds
Adding < liferay-theme:defineObjects /> to your page, as
that injects a value for themeDisplay
Other than that, adding the necessary #page and #taglib directives, and all should work.
You don't create render or action urls to pages, but to portlets.
If you want to pass parameters between portlets on the same page, use inter portlet communication.
If you want to redirect to a page with different portlet, make your portlet configurable and specify the page url in the portlet preferences. In general, you don't know the page where the target portlet will be placed to. It can be a single page or multiple pages or anything.
If you want to pass parameters to a portlet on a different page, make the page url configurable and pass the parameters through friendly url.

No data in Sitecore Experience profile

I've set up a local Sitecore environment with all sql and mongodb db's working.
Except i do not get any data in the experience profile (contacts)
I see that tracking_contact db is empty in mongo and also the analytics index folder is empty.
Other functionalities like experience analytics work fine.
Are there any extra configurations necessary?
The Experience Profile runs on the Analytics index. If there is no index, there will be no data shown.
Try to rebuild the index if it's not there.
There is an admin tool for rebuilding the reporting db & analytics index: /sitecore/admin/RebuildReportingDB.aspx
When you run the tool you must setup a secondary reporting db first.
Just attach another empty analtyics database to your local SQL and name it something like analytics_secondary and configure its connectionstring.
Then rebuild the reporting db and after that data should appear in your Experience Profile.
The index should be constantly refreshed by the aggregation framework (i.e. you should not need to rebuild) so if that is not happening, something is wrong in your configuration.
When working with xDB you'll need to identify a user to get it to appear in the experience profile section otherwise they will be anonymous.
Try using this code here to create a contact:
https://github.com/ianjohngraham/CoreBlimey.Utils/tree/master/CoreBlimey.Utils/xDB%20Contact%20Creator
And then call the end session by using the button.
If everything is setup correctly then the contact you created will appear in MongoDB and in Experience Profile.
If you are still not getting any data then you could try these things:
Ensure you have the <sc:VisitorIdentification runat="server" /> control for asp web forms layout
the #Html.Sitecore().VisitorIdentification() control for MVC layout
Make sure you disable robot detection by changing this setting <setting name="Analytics.AutoDetectBots" />
Charley,
I also had the similar problem in past, so what I found was, it was not working in my local, but when i put it stage server it shows data to me. So same may apply to you also.
Also without "#Html.Sitecore().VisitorIdentification()" in your Layout tracking is not possible.
Hope this will help you.
cheers!!

custom pipeline on time of browsing a page

I want to call a LayoutResolver custom pipeline on time of browsing a page.
For that i created a custom pipeline and configured as below
<httpRequestBegin>
<processor patch:after="*[#type='Sitecore.Pipelines.HttpRequest.LayoutResolver, Sitecore.Kernel']"
type="Agents.Common.PipeLines.LayoutResolver, Agents.Common" />
</httpRequestBegin>
But its not working on time of browsing a page but its working when i am clicking any even from sitecore .
How it will work on time of browsing a page.
Based on the patch syntax you provided, it looks like you have configured your LayoutResolver to run after the existing LayoutResolver.
Were you intending instead to replace the existing resolver? Or to run your logic before it?
For replacing, you will want to use patch:instead. For running before the existing resolver, you will want to use patch:before
Regardless of how your processor is configured, the HTTP request begin pipeline executes for most if not all Sitecore requests - even shell ones, which I think is what you refer to in your question.
The easiest thing to start off with would be to verify that the context site is website (or whichever Sitecore site you want to affect) and anything else that might distinguish requests you want (e.g. page mode).

How do I add a custom .aspx page to sitecore?

I've recently created an aspx and aspx.cs page that needs to run alongside a sitecore website. Does anyone know how i can add these pages into the site? Our set up is very odd and would like to know recommendations before trying anything and risking breaking our setup.
You don't necessarily have to add your page to the IgnoreUrlPrefixes.
Before the ItemResolver is executed, the FileResolver is executed which checks if your request points directly to a file on disk.
You do need to configure the allowed URL extensions in the FilterUrlExtensions processor of the preprocessRequest pipeline, as such:
<preprocessRequest
<processor type="Sitecore.Pipelines.HttpRequest.FilterUrlExtensions, Sitecore.Kernel">
<param desc="Allowed extensions (comma separated)">aspx, ashx, asmx</param>
<param desc="Blocked extensions (comma separated)">*</param>
</processor>
</preprocessRequest>
So that configuration will allow *.aspx, *.ashx and *.asmx to be requested directly (it's the default configuration in Sitecore 7.0).
If you're using Sitecore 6.6 or lower, the FilterUrlExtensions processor can be found in the httpRequestBegin pipeline.
If you just drop the ASPX page in at the path you'd like it to reside, by default, Sitecore should let it be served as is by going to the corresponding URL.
Just add the pages to the projects as normal (as DustinDavis suggested) but you also need to modify IgnoreUrlPrefixes in web.config (or add a config patch file) and include the pages or folders as pipe delimited values that you want the Sitecore handlers to ignore.
You can configure the value attribute of the
/configuration/sitecore/settings/setting element in web.config with
name IgnoreUrlPrefixes to prevent Sitecore from processing specific
requests, causing ASP.NET to process the request without Sitecore.
From Sitecore Presentation Component Reference
There is more information about the how and why in this blog post by Alex Ahyba
If you have sitecore open in Visual Studio, just add them in to the project. You can access the new page directly.

(Django) Sharing authentication across two sites that are on different domains

I have two sites say foo.com and bar.com and are both Django based. Primary registration occurs on foo.com (I'd like the main user db to be here) and I'd like for three things to happen:
1) User that logs in to foo.com is automatically able to access bar.com without logging in again
2) User that logs in to bar.com directly is authenticated against foo.com user db.
3) There is no need for a user to register at bar.com directly.
How can I achieve this? If it greatly simplifies things I can make bar.com a subdomain of foo.com (eg. bar.foo.com) but they must be separate sites.
It depends on your requirements. If you're able to, the simple solution is to simply host both sites on one Django instance. In other words, your Django project hosts both sites but you have a url rewrite rule that maps foo.com to http://localhost/foo/ and bar.com to http://localhost/bar/. Django's auth system will "just work" under this scenario. Rewrite rules can of course also apply to subdomains; I've built a system that hosts hundreds of subdomains using this technique.
If this isn't an option, sharing databases between your Django instances and setting SESSION_COOKIE_DOMAIN, as mentioned by others, should work.
Your 3rd requirement could easily be solved by sharing the same database between the two sites (therefore having the same Users table.
The 1st requirement is tricky because of cross domain issues (the session cookie will not be shared).
What you are really looking for is a Single Sign On (SSO). You might consider django-openid.
I had a very similar problem but OpenID was not a viable solution for me. With the advent of multiple databases in django >1.2, it is now pretty easy to share session and login data across sites. This blog post does a great job of explaining how to get it set up. Hopefully others find this as useful as I did.
I think what you are looking for is the SESSION_COOKIE_DOMAIN setting. You would set it like this:
SESSION_COOKIE_DOMAIN = 'foo.com'
See http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-cookie-domain for more information on that. This does assume that both applications are using the same session storage backend.