https://github.com/oktadev/okta-node-cli-example
A command-line applications using Node.js
https://github.com/oktadev/okta-node-cli-example
cli-application javascript nodejs pkce
Last synced: 6 months ago
JSON representation
A command-line applications using Node.js
- Host: GitHub
- URL: https://github.com/oktadev/okta-node-cli-example
- Owner: oktadev
- License: mit
- Created: 2019-06-06T18:06:00.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-02-12T11:27:29.000Z (over 3 years ago)
- Last Synced: 2024-04-26T15:22:43.421Z (over 1 year ago)
- Topics: cli-application, javascript, nodejs, pkce
- Language: JavaScript
- Homepage: https://developer.okta.com/blog/2019/06/18/command-line-app-with-nodejs
- Size: 300 KB
- Stars: 11
- Watchers: 1
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://developer.okta.com/blog/2019/06/18/command-line-app-with-nodejs). 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:
* A recent version of [Node.js](https://nodejs.org) downloaded and installed
* A good text editor, such as [Visual Studio Code](https://code.visualstudio.com)
* A [free Okta developer account](https://developer.okta.com/signup/)To successfully run this project you will need to:
1. Clone or download the source code.
1. Run `npm install` from the command line in the project folder.
1. Copy `.env.sample` to `.env`
1. Install the [Okta CLI](https://cli.okta.com) and run `okta register` to sign up for a new account. Use `okta login` if you already have an account.
1. 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`.
1. Update `.env` with your **Issuer** and application's **Client ID**
1. 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!