Authenticate with the Skedulo CLI
Overview
Once the Skedulo CLI has been successfully installed you can log into one or more tenants (teams). This can be done either via the web (including using SSO) or with an access token that has already been generated.
Log into a tenant (or team)
Note
The tenant is also known as the Skedulo team.You need to log into a tenant before proceeding to explore the CLI further.
Important
You will need to have the name of your tenant, and have credentials to authenticate. If you don’t have credentials, please contact your Skedulo administrator.Web-based login
Web-based login is the easiest way to authenticate and allows you to log in to your tenant via your web browser.
-
Run the following command to log into your tenant:
sked tenant login web
-
Enter your tenant (team) name when prompted. Your default browser will be launched for you to log in. If you are using SSO, you will also be prompted to choose your SSO provider.
-
Once you have authenticated, the CLI will ask you if you wish to set this as the default tenant. a. If you are only working with one tenant, push enter/return. b. If you are working with multiple tenants, you can enter an alias. More on this is covered in work with multiple tenants below.
-
You will then be asked if want to upgrade the token to a long-lived token, this is useful if you expect you will be working with this tenant for an extended period of time. If you agree to upgrade the token, you will be asked to enter a lifetime for the token, in hours. You can make this an indefinite token by setting the lifetime to zero (0).
Once you have successfully logged in, you can view your tenant by running the following command:
sked tenant display
This will show you information about your default tenant.
Access token login
To log in using an API access token, do the following steps:
Important
You must have an access token (API key) for your Skedulo account and know the team environment type. Refer to Create API tokens with developer tools.-
Run the following command:
sked tenant login access-token
-
Enter your access token when prompted. The CLI will attempt to authenticate using this token.
-
Once you have authenticated, the CLI will ask you if you wish to set this as the default tenant. a. If you are only working with one tenant, hit enter. b. If you are working with multiple tenants, you can enter an alias. More on this is covered in working with multiple tenants below.
Once you have successfully logged in, you can view your tenant by running the following command:
sked tenant display
This will show you information about your default tenant.
Work with multiple tenants (aliases)
When developing solutions with Skedulo, you are very likely to end up with multiple environments (teams), such as Development (DEV), User Acceptance Testing (UAT), and Production (PROD). Within the Skedulo CLI, we call these “tenants”. A tenant represents an individual instance of Skedulo and its configuration.
The Skedulo CLI offers built-in support for managing multiple tenants and the underlying access token required to modify the tenant’s configuration.
To achieve this, when logging in to a tenant you can provide an ‘alias’. This is then used with subsequent commands to tell the CLI which tenant you wish to use.
If you don’t provide an alias when logging in, the tenant you log into will become your default. If you don’t provide one when running commands, they will be run using your default tenant.
Set up an alias
Setting up an alias is similar to the standard login commands. You can either pass the alias flag (--alias
or -a
) when running the login commands, or enter simply an alias when prompted.
For example, to set an alias and log in using the web:
sked tenant login web --alias development
or
sked tenant login web --alias production
The process from here is identical to before, however if we provide the alias flag we will not be prompted to set an alias.
Use an alias
Once you’ve set up your aliases, using them is very easy. You simply pass the --alias
(or -a
) flag to any commands you wish to run.
For example, if you wished to run the the tenant display
command with your default tenant, you would run:
sked tenant display
this would output information about your default tenant.
However, if you wished to run the same command for your aliased tenant (such a ‘development’ tenant) you would run:
sked tenant display --alias development
this would output information about your development tenant.
Get information about your logged-in tenants
To find out which tenants you are logged in to, you can run:
sked tenant list
This will display their aliases, logged in username, tenant ID, their API base path, if they are the default tenant and if their token has expired.
Log out of a tenant
If you wish to remove the login information for a tenant, this can be done with:
sked tenant logout
This can be run either without an alias (to log out of your default tenant) or with, to log out of the tenant linked to that alias.
If you logout of your default tenant, but are still logged in to others, the next tenant listed will become your default.
Next steps
Now that you’re logged in to a tenant, check out:
Feedback
Was this page helpful?