Using Unified Login

We have a web site that we are using to extend the functionality of iMIS. In 10.6 we had a custom solution for bridging the login gap from iMIS to our ASP.NET 2.0 solution. With iMIS 15, we gain access to the Unified Login functionality.

If you are writing applications to work with the iMIS database, you should use this technology. It does a great job leveraging the ASP.NET 2.0 membership infrastructure.

There is not a lot of documentation on this technology, so I will post about my solution and my lessons learned.

Here is what I found to work best for us.

Before I get into this, I need to make sure we are all clear on the difference in a virtual directory and an application in IIS. When you create a virtual it also creates an application. People often think these are synonyms, but they are not. A virtual simply lets the web server see a directory as in its tree that really may not be there. An IIS Application is a directory, physical or virtual, that has been setup in a manner that makes it logically independent from the rest of the web-site. Its purpose is basically to make sub-directories act just like real web-sites.

More Info: http://authors.aspalliance.com/PaulWilson/Articles/?id=16

Now that we have defined two important words, let look at how to implement this technology.

If your project has to run as an application, you will be using the iMIS web service to login. You will also be managing your authentication yourself.

If you can run your project inside of the iMIS application, you will use the iMIS login and authentication. This is the better solution for us, so it is the one addressed in this posting.

For discussion purposes, I will use my project name. It is called iMISAddins.

Here are the steps and things to know…
1. Put your project on the imis server.
2. Create a virtual folder inside of the program files/asi/imis/net/imis folder to point to your files. IIS will create an application at the same time, but you want to remove it. We want a virtual not an application. Remember, we can’t be an application if we plan to see the iMIS Login. Note: In IIS you want a folder with a globe on it not a gear.
3. Copy the files in your bin directory to the /net/bin directory
4. Add anything to the net/web.config that has to be declared at the application level. Leave everything else in the web.config in your folder.

You are now ready to go. Just use the Membership System that comes with ASP.NET 2.0 and you are good to go.

Two more things to note:
1. Be careful using the ~/ to get to the root of your site because that is really going to be the root of the iMIS application. You will need to use ~/imis/imisaddins or use the old school ../ to get where you need to be.
2. Don’t put anything in your global.asax.cs file because it will not be executed when you run inside of iMIS. The easy way around this is to extend the Page class with whatever you want run on everypage and make all of your pages use this new class. We traditionally use the Application_Error method to trap for Unhandled Exceptions so we can log them, but it wasn't working on the iMIS server. I just extended Page to implement Page_Error and made all of my pages use this new class to get the same basic effect.

I will be the first to tell you that learning to use the Unified Login technology has been tough at times. Now that I understand it better though, I am so thankful I stayed with it. This is a very solid foundation to use to build custom applications, and I am so thankful to be rid of my custom bridge that was used in 10.6.

If anyone has questions about Unified Login or using ASP.NET roles in your site running inside of iMIS, please let me know. I will try to help. And of course, if I am wrong on any points here...I urge the iMIS dev team to correct me.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Great Info

Chris, thanks for posting this. I plan on posting some samples of various ways to access Unified Login once I get some spare time, but having your experience out there is great. :)

I actually was the developer primarily responsible for Unified Login, so if you do have questions (or feedback of any kind; anything that's not as smooth as it could be etc) feel free to let me know. :)