REST API authentication


REST API authentication

We have successfully installed the REST API, and the example provided in the online documentation works fine.

However, in that example, userids and passwords are hardcoded and visible in the sample code.

Does anyone have examples of where the userids and passwords are not made visible, and the standard windows logon credentials are used instead and these details are passed across in the AJAX call? At our site, our windows login userid/passwords are synchronised with our Teradata Userid / passwords.
We are on Windows 10 Enterprise.


Re: REST API authentication

The message we are getting in the server logs is:


2017-02-01 18:33:06,802 WARN [http-nio-7080-exec-5] {context=Root, user=anonymous} servlet.DispatcherServlet.noHandlerFound(1114) - No mapping found for HTTP request with URI [/var/www/html/APIcall2.html] in DispatcherServlet with name 'dispatcher'


Is there any documentation for what this message means?

Re: REST API authentication

Just love the guide book on how to set this all up.


1. Make sure your pages are .html, not .HTML


2. Make sure that any apache server that is being used to call the REST server is properly responding. 


3. It is helpful to add compatability mode settings on your html page


<!doctype html>
 <meta http-equiv="X-UA-Compatible" content="IE=11">


 This is a long, complex road setting this up, and I hope this helps anyone coming along this same journey.


Still needing to know how to stop hardcoding the userid and passwords in the html!


New Member

Re: REST API authentication



I had the same issue. I had overcome the hardcoding part by below two approaches.



var username = prompt("Teradata Username");
var password = prompt("Teradata Password");

This approach will ask for a User name and password based on the jquery event. One draw back here is - Password will be visible when you type it, since its a prompt window.



jquery :
$('#popup').show(); $("#pass-done").click(function() { var username = $("#uname").val(); var password = $("#pass").val(); $('#popup').hide(); ...... html: <div id="popup"> <div>Enter Username and Password:</div> <label>Username:</label> <input id="uname"/> <label>Password :</label> <input id="pass" type="password"/> <button id="pass-done">Enter</button> </div>

 This approach shows a pop-up window , where you can type the username and password . This masks the password when you type. 


Please let me know, if this helps.