Hey guys,
I've been fighting a problem where our website logins can take between 30 seconds and 2 minutes before failing due to a timeout. This was happening when the site application pool was recycled or after a period of inactivity. After the first failure, each additional login occurred quickly. I just fixed this problem.
Our set up is Active Directory for authentication and Authorization Manager (AzMan) for Authorization. This scenario has two servers: a domain controller and a web server. The site worked perfectly when run on a developers workstation, however the extreme slowness showed up when it was published to our web server.
Now the fix (I assume you know how to do most of these things):
The application pool for the site must be running under a domain user account. I created an account named mydomain\IWAM_webserver. This account must be part of the IIS_WPG group of the web server. This user account will be used to run the ActiveDirectoryMembershipProvider.
Next, edit the security on your Authorization Store and add the domain IWAM_<user> account to the Authorization Manager Reader role. When the site consults AzMan it will do so under the application pool account.
At this point the authentication and authorization calls should be lightning.
Enjoy.