bbaley Posted March 14, 2013 Share Posted March 14, 2013 Hi all,When making a login request via REST I am getting back a 200 OK response like this:HTTP/1.1 200 OKDate: Thu, 14 Mar 2013 18:50:11 GMT Content-Length: 0 P3P: CP="ALL" Content-Type: text/xml;charset=UTF-8 Server: Apache-Coyote/1.1 </pre>but - without a session id...Oddly - if I am ALREADY logged into jasperserver, it DOES return a session ID like so;HTTP/1.1 200 OK Date: Thu, 14 Mar 2013 18:47:21 GMT Content-Length: 0 P3P: CP="ALL" Set-Cookie: JSESSIONID=4278973A7101ECC11A9504EF2107BF4E; Path=/jasperserver Content-Type: text/xml;charset=UTF-8 Server: Apache-Coyote/1.1Which appears to be giving my my current session Id, ok great, but the login is NOT working ?Doesn't make any darn sense...Here is the code I am using (as well as testing the POST using RestClient tool):function fRESTLogin() { uri_address = "http://{server-address}:8080/jasperserver/rest/login"; var xmlhttp = new XMLHttpRequest(); xmlhttp.open("POST",uri_address,true); xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); xmlhttp.send("j_username=jasperadmin&j_password=jasperadmin");}[/code]Can anyone see what I am doing wrong or incorrectly ?I couldn't see in the API documentation where I am missing anything in my request....Of course, I am not using jasperadmin/jasperadmin normally - but have tried it in testing this as shown here We are running JasperReports Server CE 4.7 on Tomcat 6 Link to comment Share on other sites More sharing options...
bbaley Posted March 19, 2013 Author Share Posted March 19, 2013 When the above fRestLogin() executes, I get a Dialog like so; Authentication required A Username and password are being requested by The Site Says: "Protected Area" Username Password Upon closing the dialog the browser message is; HTTP Status 401 - Full authentication is required to access this resource This almost seems to be indicating that permissions to the actual REST API are what it's asking for credentials to ? (since I am making a POST request with the login credentials) Does this sound reasonable or likely ? Link to comment Share on other sites More sharing options...
julien.moutel Posted July 6, 2017 Share Posted July 6, 2017 Hello,I know it's an old post but did you find a solution ?I have a similar issue.Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now