Skip to content

oktadev/okta-node-cli-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Okta Node.js Command Line Application Example

This project is the sample CLI application code for the blog post Build a Command Line Application with Node.js. This sample app demonstrates using Node.js to build a CLI application that can use PKCE to authenticate with an OAuth 2.0 API. Please read the blog post for more information!

To use this code, you will need the following:

To successfully run this project you will need to:

  1. Clone or download the source code.
  2. Run npm install from the command line in the project folder.
  3. Copy .env.sample to .env
  4. Install the Okta CLI and run okta register to sign up for a new account. Use okta login if you already have an account.
  5. Run okta apps create. Select the default app name, or change it as you see fit. Choose Native and use http://localhost:8080/callback for the Redirect URI. Set the Logout Redirect URI to http://localhost:8080.
  6. Update .env with your Issuer and application's Client ID
  7. Install the CLI app globally using npm install -g .

After installing the CLI app globally, you will have two commands you can use: hello and pkce-login.

Enjoy!

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •