REST (dynamic url) Hash parameter authentication

Olivier Cozette asked on January 13, 2016 16:36

Need to authenticate a REST request using the Hash method, but I think this case is a bit more complicated.

Normally, you can authenticate (using the procedure at an URL like this ... /news?format=json

so, the adress becomes something like: ... /news?format=json&hash=527875d49dd120b681cfd58b603f434836c4d93706ad797

BUT, how to get the hash working, when the url is dynamic ? (the '%QUERY' is replaced by JQuery, allowing the user to typeahead some string, so REST can answer only with the needed information) like in

So really, if I'm searching for 'kentico' the url to authenticate becomes:




and so on

Any ideas ? (keeping the hash method) Server is answering with a boring 403 error.

Thanks !


Recent Answers

Sean Wright answered on January 13, 2016 21:02


You could probably first send an GET request, from javascript, to your server with the url you want to access. On the server you hash the url in real time and respond to the GET request with the fully hashed url and then use this url to make your REST API request.

Since the hashes are generated using a secure key on the server there is no way to safely or practically get all hashes ahead of time (given your use case) or generate them in javascript.

This use case really fits the other authentication scenarios much better.

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on January 13, 2016 23:48 (last edited on January 13, 2016 23:48)

Use basic authentication. You can create a user account, that you'll use with basic authentication, and configure security appropriately for him. Find more details here:

2 votesVote for this answer Mark as a Correct answer

Juan Alchourron answered on January 15, 2016 00:08

Thank you Sean and Roman, your approach is the good one.

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on January 17, 2016 15:13

AFAIK, Kentico do not support dynamic URL's with Hash Authentication. You may be able to send core parameterized requests however not this one.

Thanks, Chetan

0 votesVote for this answer Mark as a Correct answer

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