Skip to content

Provide instructions or flow support for globus client authorization on headless servers #562

@tschad

Description

@tschad

I often wish to initiate DKIST globus transfers from a remote headless server. I do this through a jupyter lab session that is port forwarded to a local machine, e.g.,

# On remote machine
jupyter lab --no-browser -port=1234 

#On local machine 
ssh -CNL localhost:1234:localhost:1234 <IP_ADDRESS_REMOTE> 

# in browser jupyter lab session on localhost:1234
# initiate transfer as follows...
dkist.net.transfer_complete_datasets(result["dkist"],path = '/some_path/')

The last step leads to the globus client authorization workflow. A url is provided for authorization within a browser on the local machine from Globus. This steps works okay.

The issue is then the callback from the Globus authorization. It sends that callback via 127.0.0.1: where the PORT is some random number. Unless the local machine is connected to that remote port, the browser presents a "connection refused" error in the browser.

A workaround is to ssh into that port on the remote machine
ssh -CNL localhost:<PORT>:127.0.0.1:<PORT> <IP_ADDRESS_REMOTE>
Then opening the local browser to localhost: will allow the callback to be received and then the transfer is authencated and commences.

I'm certain that are a number of ways to achieve the same result, but it is not particularly intuitive. And so, I would suggest either that the dkist.net tools provide support for this workflow in some way, or that a work around is documented in the user tools documentation.

As a note, the random port assignment for the callback seems to originate from

def start_local_server(listen=("localhost", 0)):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions