Validate user credentials in kentico Database from mobile application

kalpak shambharkar asked on March 3, 2017 08:10

We have requirement of validating user available in kentico's CMS_User table from mobile application. Please suggest any solution to achieve this ?

Correct Answer

Peter M answered on March 3, 2017 09:00

You can use Kentico REST services

Select * from cms_user where UserIsEditor=1 in terms of REST is GET

~/rest/cms.user?Where=UserIsEditor=1

1 votesVote for this answer Unmark Correct answer

Recent Answers


Roman Hutnyk answered on March 3, 2017 09:07 (last edited on March 3, 2017 09:12)

Include Kentico DLLs into your application and use Kentico API to do so. See the example here.

Another option would be using Kentico REST service: try to setup authorization token and if request was successful - user exists in Kentico:

https://<your project URL>/rest/settoken?username=<your user name>&password=<your password>&token=<your authentication token>
3 votesVote for this answer Mark as a Correct answer

kalpak shambharkar answered on March 7, 2017 06:48

hi Roman Hutnyk, I tried including kentico dll's into application with Using the Kentico API externally but got some error "cms.class not found" , I may be done some mistake. Kentico's REST service solved my problem. Thanks Roman and Peter for nice suggestion. Special thanks to Peter, "where" clause helps me a lot.

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on March 7, 2017 13:16

Hi Kalpak,

I would rather create a webservice and use Kentico's API to call and check for the user validation. The only problem that i face using a REST service that you will have to regenerate the authorization token for each of your servers like Dev, Stage and Production.

Thanks, Chetan

0 votesVote for this answer Mark as a Correct answer

kalpak shambharkar answered on March 9, 2017 08:50

Hi Chetan, Have you created Webservice in kentico itself or Webservice as external application? If in kentico then can you share steps to consume it in external application, If webservice is external application then can you provide steps to call kentico API in external application. I tried both scenarios which is redirecting to logon page. Also Kentico's REST api is not working for Intranet Portal, even i did all settings available in Kentico REST. Intranet portal is my kentico Website project, Same settings is did for Kentico Web-Application project which works perfectly. My problem is REST request redirects automatically on logon page after hitting REST url for Intranet portal. My REST URL is "http://domainname/Kentico9/rest/cms.user/currentsite?format=json"

and output is login page of kentico

"http://domainname/Kentico9/CMSPages/logon.aspx?ReturnUrl=%2fKentico9%2frest%2fcms.user%2fcurrentsite%3fformat%3djson&format=json"

Please suggest if any solution.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.