API
Version 7.x > API > Webservice Authentication View modes: 
User avatar
Member
Member
leandro.alves - 12/28/2012 10:20:13 AM
   
Webservice Authentication
Hi,
I'm trying to authenticate a user throw a kentico webservice, without sucess.
I add a WCF to kentico, that return a XML data. This webservice should be public, so each request should be Authenticated throw a Kentico user to control the data each one can access.

I'm trying to use, kentico API, but when I try to authenticate a user always get a null object, and the user never get authenticated.
My code below...
    /// <summary>
/// Try authenticate a user
/// </summary>
/// <param name="user"></param>
/// <param name="pw"></param>
/// <param name="siteName"></param>
/// <returns></returns>
public bool Authentication(string user, string pw, string siteName)
{
if (UserInfoProvider.AuthenticateUser("administrator", "xxxxx", siteName) != null)
{
return true;
}
return false;
}

Thanks.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/2/2013 4:07:02 AM
   
RE:Webservice Authentication
Hi,

In version 7 the aspNetCompatibilityEnabled parameter is set to true - to share the session for WCF and application, so the user does not need to logon twice - e.g. it is used for the chat module.

However, if you want to use separate authentication, it is not that easy as it looks - you would need to built fully custom membership provider just for the web service authentication.

As your question concerns adding complex functionality to Kentico and would require very in-depth explanations, I would recommend that you consider our paid consulting services which would offer you much more detailed and hands-on support for this project. You can find more information on our web site.
Your question is particularly well suited for the consulting service.

Best regards,
Juraj Ondrus