Help and Support
Ask a question, report a problem, request a feature...
<<  Back To Forum

Connect to Tixati from Java

by knighttixati on 2023/08/25 06:25:46 AM    
I am using the Jsoup library for Java to connect to the Tixati web interface with no password and it works, but when I configure the interface with username and password there is no way for it to work, how do I connect from Java to the Tixati web interface with username and password configured?

My code is the following:

String username = "user";
String password = "pass";

String url = "https://127.0.0.1:8888/transfers";

String credentials = username + ":" + password;
String base64Credentials = Base64.getEncoder().encodeToString(credentials.getBytes());

Connection connection = Jsoup.connect(url)
       .header("Authorization", "Basic " + base64Credentials);

try {
   Response response = connection.validateTLSCertificates(false).execute();
   System.out.println("Connected");
} catch (Exception e) {
   System.out.println("Error");
   e.printStackTrace();
}

by Guest on 2023/08/30 12:33:35 AM    
Hi knighttixati



I don't think your BASE64 encoding theory is correct on it's own.
You'd maybe need to check RFC7616 documentation for 'HTTP Digest Access Authentication'

https://httpwg.org/specs/rfc7616.html
OR
https://datatracker.ietf.org/doc/html/rfc2617

I think you are maybe missing "md5" digest (hashing) part in your code.


I also think you need to set a client nonce value "cnonce" (8 chars of hex) for randomness.
You can probably hard code a fixed value in your case. But a browser would probably randomize this value each attempt.

I'd need to read up on this to answer any more!

If you are stuck, you could cheat! Use putty for ssh (port 22) and create a rule to forward the localhost port (no tixati) to the machine (with tixati)
That means you can use http but it won't traverse the internet in cleartext you'll pipe it over encrypted ssh tunnel.

You'd need to run ssh server and open the port.

OR mega cheat coming up.

Install (free) Teamviewer installed on the Tixati PC. Use the portable teamviewer exe on your non-tixati machine?


Let us know if any of this helps?
by notaLamer on 2023/08/30 11:20:05 PM    
Have you tried inspecting the network requests in your browser's devtools?




This web site is powered by Super Simple Server