Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 6.x > Installation and deployment > Problems using the RESTful service View modes: 
User avatar
Member
Member
greg.hardin-truematter - 11/9/2011 2:59:58 PM
   
Problems using the RESTful service
I've followed the steps listed here
http://devnet.kentico.com/docs/devguide/index.html
and here
http://devnet.kentico.com/docs/devguide/index.html

and now whenever I try to use the service I get a 401 unauthorized response.

for example http://myhostname/rest/cms.country responds with unauthorized.

I've set it to use forms authentication and I am logged into the system.

User avatar
Kentico Support
Kentico Support
janh-kentico - 11/10/2011 3:35:13 AM
   
RE:Problems using the RESTful service
Hello,

If you have enabled Forms Authentication in your IIS server, please go to the Site Manager -> Settings -> Integration -> REST and set following properties:

Service enabled: true
Authentication type: Basic authentication

Now you might be able to use this service.

Best regards,
Jan Hermann

User avatar
Member
Member
greg.hardin-truematter - 11/10/2011 8:20:06 AM
   
RE:Problems using the RESTful service
Ok that does allow me to properly use the service.

Is there anyway to not require authentication at all if I just want to use it in read-only mode?

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/10/2011 8:37:43 AM
   
RE:Problems using the RESTful service
Hello,

The authentication is always required, because you don't want to display your private data from Kentico CMS to anyone.

Best regards,
Jan Hermann

User avatar
Member
Member
jwbanning-gmail - 12/5/2011 3:58:50 PM
   
RE:Problems using the RESTful service
I am still getting the authentication pop up.

I have created a Rest service that does a look up on a custom table to resolve the definition of a given "term". The service works, but I am trying to make is so there is no authentication pop up. I have used the option at CMS SiteManager > Settings > Integration > REST > Generate authentication hash for URL to create the following URL to be used in the REST request

var RestURL ="/rest/customtableitem.PHT_Glossary.GlossaryTerms?hash=b752cf419a6e1d9859d5155a1cfc2de56f8a27dc92a0c2254c0e0eec79cbb00b&format=json&where=Term%20Like%20'%25" +term+ "%25'";

I have also set up the following parameters on the CMS SiteManager > Settings > Integration > REST menu:

General
--------------------------------------------------
Service enabled: True
Service enabled for: 0
Authentication type: basic
Always check document security: False
Document access is read only: True
Object access is read only: True
Allowed document types:
Allowed object types:
Generate authentication hash for URL: False

I have also gone into IIS and enabled the Basic authentication mode. But when I view the console log i get the following:

"NetworkError: 401 Unauthorized - http://localhost/rest/customtableitem.PHT_Glossary.GlossaryTerms?hash=b752cf419a6e1d9859d5155a1cfc2de56f8a27dc92a0c2254c0e0eec79cbb00b&format=json&where=Term%20Like%20%27%25Evidence-based%25%27"

User avatar
Kentico Support
Kentico Support
kentico_janh - 12/6/2011 4:53:37 AM
   
RE:Problems using the RESTful service
Hello,

I am sorry, there is a bug with the encoded spaces and other specials characters (%20, %27). It will be fixed in the hotfix next week!

Best regards,
Jan Hermann

User avatar
Member
Member
Fraser.Baldwin-t4g - 2/28/2012 5:49:59 PM
   
RE:Problems using the RESTful service
But we do want some of the data to be available publicly, is that not possible?

User avatar
Kentico Support
Kentico Support
kentico_janh - 3/1/2012 7:06:04 AM
   
RE:Problems using the RESTful service
Hello,

You can you can generate an authentication hash for a specified URL in the Site Manager -> Settings -> Integration -> REST interface. This hash can be used instead of authentication afterwards to access specified data as it is described here: http://devnet.kentico.com/docs/devguide/rest_settings.htm

This way, the web part should display data regardless of whether the user has been authenticated or not.

Best regards,
Jan Hermann

User avatar
Member
Member
jheavner-ce - 3/29/2012 5:17:58 PM
   
RE:Problems using the RESTful service
The documentation is not very clear on how the authentication hash is supposed to work. After some trial and error I learned that the hash only appears to work with Forms authentication selected. I have yet to see if the hash is environment specific or will need to be generated for my staging and prod environments as well.

IMO, a Authentication type of Public would be a welcome addition for a lot of people.

User avatar
Kentico Support
Kentico Support
kentico_janh - 4/2/2012 5:44:00 AM
   
RE:Problems using the RESTful service
Hello,

The hash is generated and based on entire url with query strings, so it is domain specific (your staging server will have a different hash for the same thing). Public authentication type is a potential security problem, so that is the reason, why we implement hashes.

Best regards,
Jan Hermann

User avatar
Member
Member
layek.suman-gmail - 9/20/2012 6:07:28 AM
   
RE:Problems using the RESTful service
Can we use Hash authentication with RESTful requests. In the documentation it is not clearly mentioned how to do the same in kentico CMS. My other queries related to this are following..

A) Which authentication mode should be selected when using hash ?
B) What kind of requests I can authenticate using hash token ?

User avatar
Kentico Support
Kentico Support
kentico_janh - 9/20/2012 11:53:48 AM
   
RE:Problems using the RESTful service
Hello,

A) Please use same setting as they are described in our documentation here and here (Forms authentication enabled in IIS, Basic authentication in Site Manager)
B) That hash always authenticate a URL, so any request you are able to build up into a URL can be authenticate by the hash. However as a standard URL, these requests are GETs. If you want to send different requests than GETs, you need to generate entire request as it is described here and the atuhentication is present in that request, so you don't need to sign anything then.

Best regards,
Jan Hermann