Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages<12
Unable to login after AD Integration
Roger Martin
#21 Posted : Friday, 8 October 2010 7:21:58 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

I wish I could make the process easier for you. I believe the targetFramework attribute is new in .NET 4.0, so if you are getting an error that means your web.config is set up for .NET 4.0 but the IIS application pool is running under .NET 2.0. Try changing your app pool to 4.0.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
mk1 black limited
#22 Posted : Friday, 8 October 2010 8:33:44 AM(UTC)
Rank: Member

Joined: 7/08/2010(UTC)
Posts: 16
Location: Norway

Ah, but it does run under 4.0...

Do you see anything strange in the web.config? Follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.web">
<section name="galleryServerPro" type="GalleryServerPro.Configuration.GalleryServerProConfigSettings, GalleryServerPro.Configuration" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false" />
</sectionGroup>
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching" requirePermission="false" />
</configSections>
<connectionStrings>
<clear />
<add name="ADConnection" connectionString="LDAP://SERVERNAME/CN=Users,DC=DOMAIN,DC=COM" />
<add name="SQLiteDbConnection" connectionString="Data Source=|DataDirectory|galleryserverpro_data.sqlite;Version=3;" />
<add name="SqlServerDbConnection" connectionString="server=SERVERNAME\SQLEXPRESS;uid=gsp_owner;pwd=PASSWORD;Trusted_Connection=no;database=GalleryServerPro;Application Name=Gallery Server Pro" />
</connectionStrings>
<appSettings>
<add key="ComponentArtScriptControls" value="PerControl" />
</appSettings>
<cachingConfiguration defaultCacheManager="Cache Manager">
<cacheManagers>
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage" name="Cache Manager" />
</cacheManagers>
<backingStores>
<add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching" name="Null Storage" />
</backingStores>
</cachingConfiguration>
<system.web>
<pages theme="" styleSheetTheme="" validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"></pages>
<galleryServerPro configSource="gs\config\galleryserverpro.config" />
<!-- <trust level="Full" /> -->
<globalization uiCulture="auto:en" culture="auto:en-US" />
<xhtmlConformance mode="Strict" />
<compilation debug="false" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<!-- The <authentication> section enables configuration of the security authentication mode used by
ASP.NET to identify an incoming user.
The timeout is set to 129,600 minutes by default, which is 90 days. This allows the user to be automatically
logged in (requires selecting the "Remember Me" checkbox during login which sets a persistent cookie).
Note that when the user clicks "Log out", the persistent cookie is removed and the user will have to
log in next time. -->
<authentication mode="Forms">
<forms protection="All" timeout="129600" slidingExpiration="true" />
</authentication>
<authorization>
<!-- <deny users="?" />-->
</authorization>
<!-- Configure the Membership provider.-->
<membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
<providers>
<clear />
<add name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnection" enableSearchMethods="true"/>
</providers>
</membership>
<!-- Configure the Role provider.-->
<roleManager enabled="true" cacheRolesInCookie="true" cookieProtection="Validation" defaultProvider="SqlRoleProvider">
<providers>
<clear />
<add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection" name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
</providers>
</roleManager>
<!-- Configure the Profile provider.-->
<profile defaultProvider="SqlProfileProvider">
<providers>
<clear />
<add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection" name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" />
</providers>
<properties>
<add name="ShowMediaObjectMetadata" defaultValue="false" type="String" allowAnonymous="false" />
<add name="UserAlbumId" defaultValue="0" type="Int32" allowAnonymous="false" />
<add name="EnableUserAlbum" defaultValue="true" type="String" allowAnonymous="false" />
</properties>
</profile>
<httpHandlers>
<add verb="*" path="ComponentArtUploadProgress.axd" type="ComponentArt.Web.UI.UploadProgressHandler, ComponentArt.Web.UI" />
<add verb="*" path="ComponentArtScript.axd" type="ComponentArt.Web.UI.ScriptHandler,ComponentArt.Web.UI" />
</httpHandlers>
<httpModules>
<add name="ComponentArtUploadModule" type="ComponentArt.Web.UI.UploadModule, ComponentArt.Web.UI" />
</httpModules>
<sessionState mode="InProc" timeout="60" />
<!-- The <customErrors> section controls what happens if/when an unhandled error occurs. This setting is
ignored if enableExceptionHandler=true in galleryserverpro.config.
The mode attribute must be one of these values: Off (No redirection is performed; all users get detailed
error message), On (all users are redirected to friendly error page), RemoteOnly (local users see detailed
error message, remote users are redirected) -->
<customErrors mode="RemoteOnly" />
</system.web>
<!--
The site admin page lets you specify the smtp server and port, and the entries are stored in galleryserverpro.config.
If you need to specify a username and password, you can do so here. When this section is configured, the smtp
server and port in galleryserverpro.config are ignored, so make sure to include the server and port here. Uncomment
the section below to make it take effect. -->
<!--
<system.net>
<mailSettings>
<smtp>
<network
host="relayServerHostname"
port="portNumber"
userName="username"
password="password" />
</smtp>
</mailSettings>
</system.net>
-->
<!-- By default ASP.NET prevents file uploads larger than 4 MB. To change this, increase the maxRequestLength
attribute for all pages that host the Gallery Server Pro user control. Ex: To allow files up to 2 GB, use
maxRequestLength="2097151". This value should be the same or higher than the maxUploadSize setting in
galleryserverpro.config (which is exposed on the Site admin - Media objects - General page). The maxUploadSize
setting is the preferred way to manage upload sizes, as GSP provides a friendly message when that value is
violated, which is not possible when maxRequestLength is violated.

It is also recommended to increase the timeout from the default value
of 90 seconds to allow for long-running tasks such as file uploads. Set the
executionTimeout attribute to the desired value (8 hours = 28800, 24 hrs = 86400). -->
<location path="default.aspx">
<system.web>
<httpRuntime maxRequestLength="2097151" executionTimeout="86400" />
</system.web>
</location>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483647" />
</webServices>
<scriptResourceHandler enableCompression="true" enableCaching="true" />
</scripting>
</system.web.extensions>
<system.webServer>
<!-- By default IIS 7 restricts uploads larger than about 30 MB. To allow larger uploads, use the <requestFiltering>
element to set a new value. The attribute maxAllowedContentLength is in bytes, so to set a new value of 2 GB,
use 2147483648 (2 * 1024 * 1024 * 1024).
Note: If you get an error that requestFiltering cannot be overriden you must edit
%windir%\System32\inetsrv\config\applicationHost.config file and change the string:
<section name="requestFiltering" overrideModeDefault="Deny" />
to:
<section name="requestFiltering" overrideModeDefault="Allow" />

-->
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648"/>
</requestFiltering>
</security>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="ComponentArtUploadModule" />
<add name="ComponentArtUploadModule" type="ComponentArt.Web.UI.UploadModule, ComponentArt.Web.UI" />
</modules>
<handlers>
<remove name="ComponentArtUpload" />
<remove name="ComponentArtScriptHandler" />
<add name="ComponentArtUpload" path="ComponentArtUploadProgress.axd" type="ComponentArt.Web.UI.UploadProgressHandler, ComponentArt.Web.UI" verb="*" />
<add name="ComponentArtScriptHandler" path="ComponentArtScript.axd" type="ComponentArt.Web.UI.ScriptHandler,ComponentArt.Web.UI" verb="*" />
</handlers>
<defaultDocument>
<files>
<remove value="default.aspx" />
<add value="default.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
mk1 black limited
#23 Posted : Friday, 8 October 2010 8:39:19 AM(UTC)
Rank: Member

Joined: 7/08/2010(UTC)
Posts: 16
Location: Norway

Huh...strange. I removed this from web.config:

<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483647" />
</webServices>
<scriptResourceHandler enableCompression="true" enableCaching="true" />
</scripting>
</system.web.extensions>

Changed the app pool from NET 4.0 to NET 2.0, so I got the .NET Users icon in IIS Mgr again, and hey presto, it actually populated the -NET Users list with users from the AD!

However, I can't select any roles, I have an alert that says: "Could not retrieve the roles because the roles provider may not be correctly configured."

Getting closer here now methinks, but any clue that may push me in the correct direction is highly appreciated! ;-)
Roger Martin
#24 Posted : Friday, 8 October 2010 8:49:49 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Nothing jumps out at me. I am surprised it works at all considering you now have a .NET 4.0 web.config file running under a .NET 2.0 app pool.

Does the VS config utility work?
Roger Martin
Creator and Lead Developer of Gallery Server Pro
mk1 black limited
#25 Posted : Friday, 8 October 2010 3:10:49 PM(UTC)
Rank: Member

Joined: 7/08/2010(UTC)
Posts: 16
Location: Norway

Got it! ;-)

Added <remove name="AspNetSqlRoleProvider"/> in the <providers> section (got that from this page: http://www.velocityrevie...ovider-not-working.html ). Then got the "Unrecognized attribute 'targetFramework'" again. Removed that attribute from web.config, and tried .NET Users again...no errors! Could now add myself to the System Administrator role.

Put the parts I've removed from web.config back again, changed the application pool back to a 4.0 pool, crossed my fingers and tried to log in from the web page with my AD user...it worked! Phew! ;-)

PS: One more thing that had me confused earlier on was what you wrote in the second post in this thread:

"You are entering the username/pwd incorrectly. Try different combinations with/without the domain. Ex: "MyDomain\Roger" versus "Roger""

I didn't try logging in with username@domainname until just recently.

Hope this helps someone else. :-)
Rss Feed  Atom Feed
Users browsing this topic
Guest
2 Pages<12
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.