I am running the new rstudio server and trying to set up the app on open ondemand but I keep running into the auth-do-sign-in error. The connection.yml file is generated successfully but on using the chrome inspect tool, there is no form parsed. I’ve tried checking all topics and still haven’t been able to resolve this.
That’s right, I figured that could be the problem after reading a couple of posts. But I’ve still not been able to get around it.
If it helps, I can share the content of my files to confirm.
<script type="text/javascript">
(function () {
let date = new Date();
date.setTime(date.getTime() + (1*24*60*60*1000)); // 24 hours
let expires = "expires=" + date.toUTCString();
// Explicitly target the exact proxy node path for the cookie scope
let cookiePath = "path=/rnode/<%= host %>/<%= port %>/";
// Generate the double token layout required by RStudio 2024/2026 proxy security
document.cookie = "csrf-token=<%= csrf_token %>;" + expires + ";" + cookiePath + ";SameSite=Lax;secure";
document.cookie = "rs-csrf-token=<%= csrf_token %>;" + expires + ";" + cookiePath + ";SameSite=Lax;secure";
})();
</script>
<form action="/rnode/<%= host %>/<%= port %>/auth-do-sign-in" method="post" target="_blank">
<input type="hidden" name="csrf-token" value="<%= csrf_token %>"/>
<input type="hidden" name="rs-csrf-token" value="<%= csrf_token %>"/>
<input type="hidden" name="username" value="<%= ENV["USER"] %>">
<input type="hidden" name="password" value="<%= password %>">
<input type="hidden" name="staySignedIn" value="1">
<input type="hidden" name="appUri" value="/">
<button class="btn btn-primary" type="submit">
<i class="fa fa-r-project"></i> Connect to RStudio Server
</button>
</form>
Before
# rstudio 1.4+ needs a csrf token
csrf_token=<%= SecureRandom.uuid %>
# Export the module function if it exists
<% if context.cluster =~ /kubernetes/ -%>
exec &> >(tee -a "pod.log")
source /etc/profile.d/lmod.sh
source /bin/find_host_port
source /bin/save_passwd_as_secret
password="$PASSWORD"
host="$HOST_CFG"
port="$PORT_CFG"
export SINGULARITY_HOME="$HOME"
/bin/bash /opt/open_ondemand/helpers/k8_helper csrf_token "$csrf_token"
<% else -%>
[[ $(type -t module) == "function" ]] && export -f module
# Find available port to run server on
port=$(find_port ${host})
# Define a password and export it for RStudio authentication
password="$(create_passwd 16)"
<% end -%>
export RSTUDIO_PASSWORD="${password}"
export csrf_token="<%= csrftoken %>"
~
Also I guess I’d just verify if you can actually just enter in the username & password through the UI as you see it there manually. This isn’t what you’ll ask your users to do of course, it’d just be good as a debugging step to ensure you can login.