You're using Kentico CMS and you need to log someone in. Maybe you're doing a custom registration form, or an OAuth integration. Whatever the case, it's super easy. You simply call the
AuthenticateUser static method on the
CMSContext class. Here is the method signature:
public static void AuthenticateUser(string userName, bool createPresistentCookie);
And this is how you would call it:
CMSContext.AuthenticateUser("my username", true);
Piece of cake!
Need hosting? I use and recommend a Digital Ocean SSD VPS server! Check out my referral link below:blog comments powered by Disqus