Giter VIP home page Giter VIP logo

samples-nodejs-express-4's Introduction

Express Sample Applications for Okta

This repository contains several sample applications that show you how to integrate various Okta use-cases into your Node.js application that uses the Express framework.

Configuration

All of the samples share a single configuration file, config.js. The config uses environment variables which can be either exported in the shell or stored in a file named testenv in this directory. See dotenv for more details on this file format. It may look something like:

ISSUER=https://yourOktaDomain.com/oauth2/default

# Web app
CLIENT_ID=123XX
CLIENT_SECRET=456XX

# SPA app
SPA_CLIENT_ID=123YY

Please find the sample that fits your use-case from the table below.

Sample Description Use-Case
Okta-Hosted Login An application server that uses the hosted login page on your Okta org, then creates a cookie session for the user in the Express application. Traditional web applications with server-side rendered pages.
Custom Login Page An application server that uses the Okta Sign-In Widget on a custom login page within the application, then creates a cookie session for the user in the Express application. Traditional web applications with server-side rendered pages.
Resource Server This is a sample API resource server that shows you how to authenticate requests with access tokens that have been issued by Okta. Single-Page applications.

Running the tests

Before running the tests you will need to gather values for ALL required environment variables. You can export these variables in the shell or store them in a file named testenv in the current directory.

You will need two Okta applications, one Web app and one SPA app. Save the clientId for the Web app as CLIENT_ID and the clientId for the SPA app as SPA_CLIENT_ID

The Web app needs a couple of settings in the Developer console: Add a Login redirect URI: http://localhost:8080/authorization-code/callback Add a Logout redirect URI: http://localhost:8080

You will also need credentials for a test user.

ISSUER=https://yourOktaDomain.com/oauth2/default
CLIENT_ID=123xxxxx123
CLIENT_SECRET=1234XXX
SPA_CLIENT_ID=123yyyy123
USERNAME=testuser
PASSWORD=testpass

With all variables set, run npm test

samples-nodejs-express-4's People

Contributors

vijetmahabaleshwar-okta avatar aarongranick-okta avatar rchild-okta avatar robertjd avatar brettritter-okta avatar lboyette-okta avatar meshoo12 avatar jmelberg-okta avatar swiftone avatar denysoblohin-okta avatar derektiffany avatar hagenhaus avatar nbarbettini avatar oleksandrpravosudko-okta avatar shuowu-okta avatar jmaldonado-okta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.