The Okta CLI is the easiest way to get started with Okta!
For Java developers using Apache Maven, there's the Okta Maven Plugin.
Follow the directions for your platform to install the CLI. For more information on installing and using the CLI, see the Okta CLI Documentation.
macOS Using Homebrew
Run the following command in a terminal to install the CLI:
brew install --cask oktadeveloper/tap/oktaTo update to a new CLI version:
brew reinstall oktaNOTE
If you have issues installing the latest version, try removing the CLI using
brew untapand then runningbrew installagain:brew uninstall okta brew untap oktadeveloper/tap brew install --cask oktadeveloper/tap/okta
First add the Flathub repo if it's not already installed by running:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepoNext, install the package:
flatpak install flathub com.okta.developer.CLIFinally, add an alias to the command to the appropriate shell configuration ("dot") file:
alias okta="flatpak run com.okta.developer.CLI"Run the following command in a terminal to install the CLI:
curl https://raw.githubusercontent.com/okta/okta-cli/master/cli/src/main/scripts/install.sh | bashRun the following command in a terminal to install the CLI:
choco install okta --version=0.10.0Open the releases download page for the Okta CLI and download the executable file for your OS. Move that file to the desired location in your system. If appropriate, add the directory to your shell PATH environment variable, or add an alias in to the executable in the appropriate shell configuration ("dot") file.
For general help run:
okta --help
For help on a specific command, run:
okta help <command>
Run okta register to sign up for a new account. During the process you'll receive a verification code in a confirmation email sent from [email protected]. If you don’t receive the email, check your spam folders.
Make a note of the Okta Domain that's shown after your account is created as you'll use this for logging in and when you create apps.
IMPORTANT
Set the password for your Okta developer organization by opening the link that’s shown after your domain is registered. Look for output similar to this:
Your Okta Domain: https://dev-xxxxxxx.okta.com
To set your password open this link:
https://dev-xxxxxxx.okta.com/welcome/xrqyNKPCZcvxL1ouKUoh
Run okta login to login to your developer Okta organization. You'll need the domain of the Okta organization domain and an access token.
NOTE
You are automatically logged in when you useokta registerto create an account.
To generate an access token:
- Log in to the admin console of your Okta organization.
- Open Security > API.
- Select the Tokens tab and then select Okta API.
- Click Create Token and then enter a name for the new token.
Run the okta apps create command to create the Okta Application Integration for your single app. The CLI supports creating:
- Web apps: Backend applications using Java, .Net, PHP, etc.
- Single page app (SPA): Browser based applications.
- Native app: Mobile and desktop application.
- API service: Machine to machine services.
You're prompted for the type of app and other required information. Note down the information shown after creating the integration as you'll need that for your app.
The third party software "bash-completion" enables adding command completion for the Okta CLI. To add completion run the command for your platform. For more information on bash-completion, see the providers documentation.
okta generate-completion > /usr/local/etc/bash_completion.d/okta###Linux
okta generate-completion > /etc/bash_completion.d/oktaIf you aren't using "bash-completion", copy the output of okta generate-completion to your desired location, and source the file from your ~/.bash_profile script, for example:
okta generate-completion > ~/okta.bash
echo `. ~/okta.bash` >> ~/.bash_profileOkta Command Line Interface is an open project on GitHub. We invite you to download the source and propose changes.
Build your local version of the Okta CLI using SDKMAN!.
Set sdkman_auto_env=true in ~/.sdkman/etc/config to select the correct JVM when you switch to the Okta CLI project folder.
Alternately, when you are in the project folder select the correct JDK by runing sdk env.
Run mvn clean install to build the CLI.
NOTE
To avoid IntelliJ compiler errors for data classgetterandsetter, add the Lombok plugin.
Install your CLI build by running gu install native-image.
Run your build using ./cli/target/okta.