We have web application with SQL ASP Membership Provider, Role manager and profile provider. This web application has both authentication methods: NTLM and forms. Everything works fine.

Problem occurs when we extend our web application and configure it with form auth only. When I try to access page with webpart, which makes use of ASP profiles, I get 403 forbidden. The same webpart, accessed by forms authentication from our original web app (not extended), everything works fine.

Here is method I use to retrieve profile property:

public static string GetCitizenId(string login)
    LoggingService.LogInfo(String.Format("Getting citizen Id for login '{0}'", login));
    string citizenId = null;

    if (login != null)
        LoggingService.LogInfo("Login exists");
            var userProfile = ProfileBase.Create(login);

            LoggingService.LogInfo("Does profile exist? " + (userProfile != null));
            LoggingService.LogInfo("Username from profile: " + userProfile.UserName);

            //string crmId = userProfile["CRMId"] as string;
            string crmId = (string)userProfile.GetPropertyValue("CRMId");

            LoggingService.LogInfo(String.Format("CRMId is '{0}'", crmId)); // <<-- THIS LINE IS NEVER REACHED! NO LOG ENTRY!

            if (!string.IsNullOrEmpty(crmId))
                citizenId = crmId;
        LoggingService.LogError("Login is null");
    LoggingService.LogInfo(string.Format("Citizen id is: '{0}'", citizenId));

    return citizenId;

We log messages to ULS and I noticed that when trying to get citizen ID from extended WebApp, the line which logs citizen ID to ULS is never called. So the problem probably exist in one line above. When I debug my code, debugger stops at this line:

string crmId = (string)userProfile.GetPropertyValue("CRMId");

with exception:

Access to the path 'C:\inetpub\wwwroot\wss\VirtualDirectories\5001\App_Data' is denied.

1 Answer 1


It turned out that extended web application didnt have default profile provider configured in web.config. After manually setting profile provider for extended application, everything started to work.

  • I'm having the same issue. I'm trying Membersip.GetUser(). Not sure why it's denying me access. Any ideas?
    – harsimranb
    Sep 10, 2012 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.