Service Help – UserValidate
The Sharperlight service offers a wide variety of presentation methods, each with its own set of parameters.
In this post, we will introduce the following method from among the various presentation methods available.
http://abcd.com/mdService1Rest/UserValidate/…
{sharperlight service url}/Help#UserValidate
|
Validate the hashed user details or user name, password and Two-Factor Code and return an user session id or error message. Once the user is validated you will receive a user session id which can then be appended to all url requests id &usid=64919ad6e54348a4925faee2146e1b60Z when calling the Service
http://abcd.com/mdService1Rest/UserValidate/?userHash=UH%3D99704FD03E70F5BC23EC167BBF0153118B5D962D94E523BC9F9E36590BC7B8CC&response=json
http://abcd.com/mdService1Rest/UserValidate/?user=john&pwd=X9wd9704F&twoFACode=123888&language=en&response=json
If the Service has been setup for NTLM or Windows Authentication then the browser will do the authenication and the Service will know who the user is. Therefore this method would not be required |
|
| userHash=[UH=hash] |
SHA256 encoded user details See Authorization Header for more details on encoding the user details |
| user=[username] |
The user name for example john or john@mycompany.com or domain\john depending on the types of accounts setup in Site Setup .e.g &user=john |
| pwd=[password] |
The user password. Recommend only using this method over https &pwd=@abkkDs295na |
| twoFACode=[2FAcode] |
The user account may require a Two-Factor Authenication Code &twoFACode=223987 |
| language=[en|es|ja…] |
The user language where the default is English or whatever is set in Site Setup for the user &language=ja for Japanese |
| response=[default|json|text] |
The format of the response status e.g. &response=json The user token starts with UT= and can be used instead of a user name and password if your storing the credentials. Normally you would include the User Token in the Authorization Header with the prefix SharperLight:
SharperLight:UT=yJYuJj/Q+0fqfpWx6v/lnoZHbMA290oHXMRtbvzqJjybglEm5TuJqg==&userLanguage=ja Notice you can also force a language onto the token with &userLanguage=code If you have the user token in the Header then you will not need to put the user session id on the url If you don’t use the user token in the header then you will need to place user session id usid on all url calls to the Service. Note: The user session id can go stale if not used for many hours. You can see if the user session is still valid by calling /UserSessionCheck/?usid=64919ad6e54348a4925faee2146e1b60Z JSON SUCCESS
[ { “token”: “UT=SIvmaJcOSpp5pOZuQqRll6MxT2WQIZgUNjH16nPYN7p4ZaElisHghA==”,”usid”: “236a90ea9f2b4ac2b8eec066f58d160cZ”,”errorMessage”: “” } ]
JSON ERROR
[ { “token”: “”,”usid”: “”,”errorMessage”: “Invalid username or password” } ]
TEXT SUCCESS
“token”: “UT=SIvmaJcOSpp5pOZuQqRll6MxT2WQIZgUNjH16nPYN7p4ZaElisHghA==”,”usid”: “236a90ea9f2b4ac2b8eec066f58d160cZ”,”errorMessage”: “”
TEXT ERROR
“token”: “”,”usid”: “”,”errorMessage”: “Invalid username or password”
DEFAULT SUCCESS
YAHOO.namespace(“userValidate_get”);YAHOO.userValidate_get.data = {“token”: “UT=AVSW/FQeqMLcrKiW3vI+vy1imq+vEm/concz3T6PNktiAVjiogFq9g==”,”usid”: “a0d2c156f4fb48788ed28a63a3e4e709Z”,”errorMessage”: “” }
DEFAULT ERROR
YAHOO.namespace(“userValidate_get”);YAHOO.userValidate_get.data = {“token”: “”,”usid”: “”,”errorMessage”: “Invalid username or password” }
|
| callback=[MyFunc] | JSON Callback function (Optional) &callback=MyFunc results in MyFunc( [ { “token”: “”,”usid”: “”,”errorMessage”: “Invalid username or password” } ] ); |
