API Questions on Kentico API.
Version 6.x > API > How to Login CMSDesk directly without taking User ID and Password? View modes: 
User avatar
Member
Member
samuelmartin111-hotmail - 10/19/2011 6:00:42 AM
   
How to Login CMSDesk directly without taking User ID and Password?

Hi,

I wish to connect CMS with my existing website but in admin page I want to provide a link to open CMS Desk page for editing.

My website admin has already logged in at my admin panel so I don't want admin to again type User ID and password for CMS Desk to login.

User just click on a link of CMS and it just redirect user to CMS Desk without showing Login screen.

Please provide me a that How could I do this?

Thanks!!!

User avatar
Kentico Support
Kentico Support
kentico_radekm - 10/20/2011 6:48:45 AM
   
RE:How to Login CMSDesk directly without taking User ID and Password?
Hello.

I guess the only way is to log given user in code and create an authentication cookie for him. You can also use CMSContext.AuthenticateUser() method for it. I would recommend you to take an inspiration from \CMSPages\logon.aspx.cs, Login1_LoggedIn() method.

Best Regards,
Radek Macalik

User avatar
Member
Member
samuelmartin111-hotmail - 10/21/2011 8:44:56 AM
   
RE:How to Login CMSDesk directly without taking User ID and Password?
Hi,
Thanks for your reply
I have one doubt i need to authenticate my database user to kentico for that i need to specify my credentials in CMSContext.AuthenticateUser() method if so where should i write my code in Kentico Solution or in my solution.

Can You please help me out as this is very urgent .


Thanks!

User avatar
Kentico Support
Kentico Support
kentico_radekm - 10/24/2011 2:13:44 AM
   
RE:How to Login CMSDesk directly without taking User ID and Password?
Hello.

You need just to pass username. Not password, as authentication itself is done in some inner methods of code you call. If you navigate to code I mentioned, you can see you need just a two parameters for this method, called from CMSContext class: username and bool variable – createPersistantCookie.

As for place where to call it, well, it can be any page / control where CMSContext class is accessible and the file is secured, so un-authorized user cannot access it. This security of your project folder is up to you.

Best Regards,
Radek Macalik