If you have a web application from which you want a user to be transparently authenticated to a DNN 4.x portal, you can do it quite easily using a URL. Assuming a scenario where the usernames/passwords are synchronized, an easy way to accomplish this is as follows:

1) Have a link or button on the web application which contains the username and password. Now, it goes without saying that you do not want this in plain-text and should encrypt both and share the key between the web app and the DotNetNuke portal. A good solution for this is Secure Query Strings. Since the referenced article does a great job of explaining how these work, I will not dwell on the topic.

2) At the receiving end (i.e. the DotNetNuke portal), you need an entry-point. A dedicated ASPX page is a logical choice. The code for the page needs to grab the querystring parameters and decrypt them. Once this is done, you have the credentials necessary to authenticate the user. The below code should do the trick:

using System;
using
System.Web;
using
DotNetNuke;
using
DotNetNuke.Entities.Portals;
using
DotNetNuke.Security;
using DotNetNuke.Common;

namespace DotNetNuke.RemoteAuthentication
{

         public class DnnAuthentication
         
{

               public static bool Authenticate(
                                       string username, string password)
               {
                     PortalSettings portalSettings =  (PortalSettings)
                                 HttpContext.Current.Items["PortalSettings"];
                     
PortalSecurity portalSecurity = new PortalSecurity();
                     
string ipAddress =
                                 HttpContext.Current.Request.UserHostAddress;

                     if (portalSecurity.UserLogin(
                                                                username, 
                                                                password,
                                                                portalSettings.PortalId,
                                                                portalSettings.PortalName,
                                                                ipAddress,
                                                                false
                                                            
) == -1
                        )

                              return (false);

                     else

                              return (true);

               }

         }

}

The above solution is trivial and is going to be practical in a limited number of situations. However, it can be a good starting point for a more robust solution which may also include creating the user account automatically on the DotNetNuke portal.

A robust file synchronization utility is a must-have for anybody with multiple machines. I have tried many solutions and always found something to be lacking. And then I discovered MirrorFolder.

This product is simple, yet incredibly powerful. I have used it for six months now and couldn’t ask for anything more. The thing I like most about this program is that after telling it what files/folders you want synchronized, you just forget about it. MirrorFolder does its thing in the background and without bothering you. No annoying system tray notifications, no emails, no popup windows…just sync’d files.

Using MirrorFolder, I now have my notebook (my primary development machine) happily sync’d hourly with my home server (which backups to iBackup.com nightly). I have yet to notice when the sync happens since it does not seem to impact resources in any meaningful way. While this setup works great when I am working in my home office, it didn’t provide a good way to backup when I am mobile.

After researching my options, I decided that an ultra-compact USB drive is the way to go. The Seagate ST90000U2 fits the bill. This little drive is compact (5″ x 3.75″ x 1″), light-weight, totally silent and gives me 120Gb of portable storage using only USB power (no bulky adapter to lug around). I set MirrorFolder to sync with it when available so when I am travelling, all I have to do is plug in the USB connector at some point and I have a backup of all changes. (If I know I haven’t made too many changes, and if I am in a hurry, I just use my Cruzer Mini 4Gb USB stick.)

On my recent trip to San Francisco and Australia, I used MirrorFolder and the Seagate drive. Both performed flawlessly and allayed my fear (paranoia?) about data loss.

 

© 2012 TechBubble Suffusion theme by Sayontan Sinha