This is the companion repository for a blog post on the Okta Developer website.
Clone the repository by running:
git clone https://github.com/oktadeveloper/okta-node-postgres-todo-example.git
Restore the NPM packages:
npm install
- Using your Postgres query tool of choice, connect to your Postgres developer server
- Create a new database named
todolist
(or use an existing development database) - Create the
Item
table in the database using the following command
CREATE TABLE Item (
id serial primary key
, title varchar(100)
, description text
, isComplete boolean
);
- Copy the included
.env.sample
file to.env
- Update the configuration in this file to match your environment, such as your Postgres database connection
- Sign up for a free Okta developer account
- Create a new Web application in the Okta Developer Dashboard
- Change the port for the Base and redirect URIs to use
3000
(e.g. Login redirect URIhttp://localhost:3000/authorization-code/callback
) - Update the Okta configuration settings in the
.env
file with your Okta application's Client Id, Client secret, and Okta Org Url (e.g.https://dev-123456.okta.com
)
Then run the application from within the root folder with:
node index.js
Please pose any questions about the blog post in the comments section of the blog post page.
Any questions about Okta in particular can be posted on the Okta Developer Forum.