As far as I know, there is no direct way to access an exposition and login simultaneously.
The way that I solved this, is to login first using wget or curl. You store the session cookie locally and reuse it for subsequent requests. Of course you will need to fetch this cookie again after some time, since RC sessions are not infinite.
The link for logging in to the RC is:
You provide username and password as url-encoded values. (?username=myusername&password=mypassword)
here's a snippet of ocaml code:
let login_cmd () =
let credentials_form_data =
[ "username="; Secret.username; "&password="; Secret.password ]
|> String.concat ""
let args =
"--post-data=" ^ credentials_form_data;
let inp = Unix.open_process_args_in "wget" args in
(* let _ = print_endline cmd in *)
read_lines inp |> String.concat "\n"
However, I'd say your share link method has some advantages as well, in that you don't have to hardcode your credentials into code.