Daniel Hoelbling-Inzko talks about programming
After almost a month and 3 weeks of having the connector in production I finally feel that it’s time for a v1.0. So, here it is. I just pushed the v1.0 tag to GitHub!
You can grab the release zip containing everything you need here:
Note on this release: Some of the existing code I published in my initial article is now outdated. Some refactoring (and a annoying typo) has gone on and I don’t have any docs ready for people trying to use this. So if you want to use ELMS-Connector on your campus, just contact me through email at [email protected] and I’ll be glad to walk you through the setup process. Docs will follow, but at the moment I don’t feel like writing documentation for something only I am using.
Changes since the Beta:
1: Configurable file extensions
2: Session Authentication
Session Authentication
The main annoyance with ELMS-Connector so far has been that whenever a User hits the MSDN-AA he has to re-authenticate himself even if he is authenticated to the source system.
I found a way to elegantly prevent that without breaking anything: IExtendedAuthenticationService
While IAuthenticationService only requires you to implement one method:
bool AuthenticateUser(string username, string password);
IExtendedAuthenticationService comes with another two:
public interface IExtendedAuthenticationService : IAuthenticationService { bool IsAlreadyAuthenticated(); string Username { get; } }
IsAlreadyAuthenticated should return true if the current user already has a open session, and Username should then return his current username. If you use IPrincipal in your web app this would look like this:
public bool IsAlreadyAuthenticated() { return HttpContext.Current.User != null && HttpContext.Current.User.Identity.IsAuthenticated; }public string Username { get { return HttpContext.Current.User.Identity.Name; } }
This way ELMS doesn’t prompt the user again for his credentials but rather directly redirects him to Microsoft’s ELMS server, making for a very smooth user experience.
If IsAlreadyAuthenticated is false, the user is presented with the usual login form and authentication works like it used to before (this happens if the user comes from the Microsoft ELMS site without having a session on your campus site).