Logging into a Hub instance¶
When you've created a connection, you can use hubcli to manage a Hub instance using that connection.
First, however, you have to log on. You can do this using the hubcli login command:
hubcli login -c myconn
The -c flag specifies the connection to use;
If the connection you want to use has been specified as the default connection, you don't need to specify the connection.
There are two supported logon methods when using the hubcli commands:
- If a web browser is available on the host on which
hubcliis run, then browser logon is supported.
This is the recommended method to use. - If there is no web browser available on the host then command line authentication can be used.
In this method, prompts for username and password are presented when the
hubclicommand is run.
Altair SLC Hub uses the standard OpenID Connect protocol for authentication. An initial authentication process has to take place involving the user providing a username and password. This initial authentication generates a refresh token. The refresh token typically has a lifespan of 30 days.
While the refresh token is valid, each time the hubcli command is run and connects to a Altair SLC Hub instance a short term access token is generated.
The access token typically has a lifespan of 1 hour.
The refresh token is stored securely in a token cache in the user's home directory.
Each time the hubcli command is run and connects to a Altair SLC Hub instance it a new refresh token is generated.
Provided that the hubcli command is run at least once during the lifespan of the refresh token, there will be no further need to enter a username and password.
If continuous refresh tokens are required, the hubcli login-refresh command can be run rather than submitting a batch job during the current refresh token lifespan to generate a new refresh token.