ASPX templates
Version 5.x > ASPX templates > Logging in a user View modes: 
User avatar
Member
Member
mickey-invision - 1/8/2010 4:07:30 PM
   
Logging in a user
How do I programmatically login a user to the site? I know I can Authenticate the user, but how do I set the proper cookie so the user is actually logged in to the site?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/11/2010 2:47:36 AM
   
RE:Logging in a user
Hi,

You can use Single sign on or Windows authentication options.

Or, you can create a custom security handler as it is described in this forum thread.

I hope it will help.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
dattaprasad.kulkarni-abps - 1/11/2010 7:31:06 AM
   
RE:Logging in a user
Hello,

*I have successfully installed the FREE CMS on my system and I want my users to use it.

Whenever they access link of my system, they get an error for licenses. ]

nvalid license key
Requested URL: http://prasad:8010/ABPSCMS/default.aspx

Validation result: Not available

If you're an administrator of this site, please go to Site Manager -> Licenses and use the following domain name to add valid license: prasad


Please help me proceed using this.

Thanks a lot,
Prasad

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/11/2010 8:13:50 AM
   
RE:Logging in a user
Hi,

you need to register to our web site and in My account section there is link to generate free license keys. You need to generate license key for each domain name you want to use.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
dattaprasad.kulkarni-abps - 1/11/2010 8:31:32 AM
   
RE:Logging in a user
I've aready registered, and have got the license key for cms installed on my system.

but still it gives an error while accessing it from other systems.

Thanks
Prasad

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/12/2010 7:55:41 AM
   
RE:Logging in a user
Hi,

Which systems you mean? What is the domain name when accessing the CMS or the web site? What errors are you getting?

You need to have license key for each and every domain name and IP address, under which you want to run the web site. And also, you need to add appropriate domain aliases and assign them to your web site.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
byron-falcon-software - 3/18/2010 11:52:05 AM
   
RE:Logging in a user
You might be looking for this. This works for me and Forms Authentication.


CMS.SiteProvider.UserInfo user = CMS.SiteProvider.UserInfoProvider.AuthenticateUser(username, password, CMS.CMSHelper.CMSContext.CurrentSite, true);

if (user != null)
{
System.Web.Security.FormsAuthentication.SetAuthCookie(user.UserName, false);
}