Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shea Daniels 8 posts 28 karma points
    Nov 02, 2009 @ 17:05
    Shea Daniels
    0

    Problem With Slashes in AD Username

    Note: I originally posted this in the bugs forum, but it now looks like that's only for forums bugs. So I'm trying again.

    We are planning on using Umbraco as the CMS for our county government web site since we've been very impressed with it. We want to use Active Directory integration in the back office for the convenience factor, but we have multiple domains. So I wrote a custom membership provider that takes in a username in "domain\username" format.

    Umbraco doesn't like this, and I'm guessing it has to do with the slash in the username. It appears to authenticate the user, but then crashes. Here's the error message and stack trace:

    Index was outside the bounds of the array. body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

    Server Error in '/' Application.

    Index was outside the bounds of the array.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [IndexOutOfRangeException: Index was outside the bounds of the array.]
       umbraco.cms.presentation._umbraco.Page_Load(Object sender, EventArgs e) +1713
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       umbraco.BasePages.BasePage.OnLoad(EventArgs e) +15
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


    Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

     

    Has anyone dealt with anything like this (multiple AD domains)? Which characters are acceptable in an Umbraco username?

  • Shea Daniels 8 posts 28 karma points
    Nov 04, 2009 @ 19:44
    Shea Daniels
    0

    I thought I'd give a quick update on where I am on researching this:

    It looks like this problem really doesn't have anything to do with the slashes, etc. When I used the standard Umbraco membership provider it handles special characters (\, -, etc) just fine.

    So I downloaded the Umbraco source code and took a look at where the exception was being thrown. It seems that when a user is created, the umbracoUser2app table is supposed to be populated with a content permissions row for that user. This works like it's supposed to when you use the standard ADMembershipProvider that comes with .NET.

    But, it appears that this isn't happening with my custom provider. When I create the row ahead of time and make an entry in the user to app table, everything works just fine.

    Any clues as to why this is happening with my provider and not the standard one? The only provider method that is being called is ValidateUser.

  • Shea Daniels 8 posts 28 karma points
    Nov 09, 2009 @ 17:48
    Shea Daniels
    0

    Still no love for this question? That's a bit disheartening.

    Well, I'll at least cap it off by putting in a link to my bug report on CodePlex:

    Bug Report

Please Sign in or register to post replies

Write your reply to:

Draft