Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.
/ node-sso-example Public archive

An example Express application demonstrating how to use the WorkOS Node.js SDK to authenticate users via SSO

License

Notifications You must be signed in to change notification settings

workos/node-sso-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Example App with SSO powered by WorkOS

An example application demonstrating to use the WorkOS Node SDK to authenticate users via SSO.

Prerequisites

Node.js version 10+

Node Project Setup

  1. In your CLI, navigate to the directory into which you want to clone this git repo.

    $ cd ~/Desktop/
  2. Clone this repo and install dependencies:

    # HTTPS
    git clone https://github.com/workos-inc/node-sso-example.git

    or

    # SSH
    git clone https://github.com/workos-inc/node-sso-example.git && cd node-sso-example && npm install
  3. Navigate to the cloned repo.

    $ cd node-sso-example
  4. Install the dependencies.

    $ npm install

Configure your environment

  1. Grab your API Key and Client ID from the WorkOS Dashboard. Create a .env file at the root of the project, and store these like so:
    WORKOS_API_KEY=sk_xxxxxxxxxxxxx
    WORKOS_CLIENT_ID=project_xxxxxxxxxxxx
    

SSO Setup with WorkOS

  1. Follow the SSO authentication flow instructions to create a new SSO connection in your WorkOS dashboard.

  2. Add http://localhost:3000/callback as a Redirect URI in the Configuration section of the Dashboard.

  3. Update routes/index.js with the Connection domain (or Connection ID).

Testing the Integration

  1. Start the server and head to `http://localhost:3000/ to begin the login flow!
npm start

Need help?

If you get stuck and aren't able to resolve the issue by reading our WorkOS Node SDK documentation, API reference, or tutorials, you can reach out to us at support@workos.com and we'll lend a hand.

About

An example Express application demonstrating how to use the WorkOS Node.js SDK to authenticate users via SSO

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published