Your call to https://<hostname>:9443/itim/j_security_check will return a 302 Found with location header set to https://<hostname>:9443/itim. This URL will return 404. Try to add -MaximumRedirection 0 to your Invoke-RestMethod call. The response will have a Set-Cookie header with the LTPA token that you need.