I have separate DBs (YAF and mine) but the website is merged (i.e. it's not a different virtual server or domain).
I basically took the YAF web.config and put my things into it rather than the other way round. As my app is a Web Application Project rather than a website project I had to compile all the DLLs for the classes and then put the things in the App_code folder into website root. The main thing to remember here is that some of the classes will compile at runtime and others not. Basically you right click on e.g. Forum.cs and click properties. Then change the build action to content. All the files in Modules I have as content too.
When I login to my website I put the following code in:
YafMembershipProvider mb = (YafMembershipProvider)System.Web.Security.Membership.Providers["YafMembershipProvider"];
int? forumUserID = 0;
if (!mb.ValidateUser(username, password))
MembershipUser forumUser = mb.CreateUser(username, password, user.Email, "question", "answer", true, null, out status);
// create the user in the YAF DB as well as sync roles...
forumUserID = RoleMembershipHelper.CreateForumUser(forumUser, 1);
// create empty profile just so they have one
YafUserProfile userProfile = YafUserProfile.GetProfile(username);
userProfile.Homepage = ConfigurationSettings.AppSettings["siteurl"] + "User/Profile.aspx?ID=" + user.ID;
// setup their inital profile information
DataTable results = YAF.Classes.Data.DB.user_find(1, false, username, user.Email);
forumUserID = (int)results.Rows["UserID"];
string thumbnailUrl = "/images/nophoto.gif";
where = new PredicateExpression();
where.Add(PhotoFields.User == user.ID);
where.AddWithAnd(PhotoFields.IsVideo == false);
where.AddWithAnd(PhotoFields.Main == true);
where.AddWithAnd(PhotoFields.Private == false);
PhotoCollection photos = new PhotoCollection();
if (photos.Count > 0)
thumbnailUrl = photos.ThumbFilename;
YAF.Classes.Data.DB.user_saveavatar(forumUserID, ConfigurationSettings.AppSettings["siteurl"] + thumbnailUrl, null, null);
There are some extra things in there for adding the avatar and the homepage in here.
If you have the websites as separate entities then you'll need to do the machine token thing that you'll have seen but I didn't need that.