isabella232 / okta-netlify-function-example

Example of a Netlify Function secured with Okta

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build a Serverless Function with Netlify Example

This project is the source code for the blog post "Build and Deploy Secure Serverless Functions with Netlify." A complete walkthrough video is also available on YouTube.

Requirements

Setup

The complete steps are explained in the blog post or video.

  • Clone or download this source code
  • Open your terminal/command prompt, change to the project folder, and install dependencies using npm install
  • Copy the .env.sample file to .env
  • Create a new "Single-Page Application" in the Okta Developer dashboard
  • Copy your application's Client ID and Org URL to the .env file
  • Edit client/index.js and change the oktaOrgUrl and oktaClientId values to match your Okta Org URL and Client ID
  • Build the project from the command line using npm run build

Running locally

npx netlify-cli dev

Note: You can also install the netlify-cli tool locally using npm install --save-dev netlify-cli or globally using npm install -g netlify-cli. After installing locally, you can use npx netlify dev or globally you can use netlify dev.

About

Example of a Netlify Function secured with Okta

License:MIT License


Languages

Language:JavaScript 90.8%Language:HTML 6.9%Language:CSS 2.2%