Node-1st-gen/okta-auth/README.md
Sample app that demonstrates how to authenticate with Firebase using Okta.
This sample has two parts:
Before you try the demo with the Firebase emulator suite or deploy it to Firebase Hosting and Cloud Functions, set up your Okta and Firebase projects, and install the Firebase CLI tool:
On the Okta Developer site:
http://localhost:5000.http://localhost:5000.http://localhost:5000 is
listed, with CORS and Redirect enabled.In the Firebase console:
If you don't already have a Node.js 10 (or newer) environment, install Node.js.
If you haven't already installed the Firebase CLI tool, do it now:
$ npm install --global firebase-tools
Make sure the Firebase CLI tool is set to use your Firebase project:
$ cd functions-samples/okta-auth
okta-auth$ firebase login
okta-auth$ firebase use <YOUR_FIREBASE_PROJECT_ID>
Run setup.js from the Firebase project directory:
okta-auth$ node setup.js
The script will prompt you for some of your Okta and Firebase configuration values and create configurations files from them. The script won't overwrite existing files.
Start the emulators:
okta-auth$ firebase emulators:start
Open the web app: http://localhost:5000.
Upgrade your Firebase project to the Blaze (pay as you go) plan. The Blaze plan is required to access external services (in this case, Okta) from Cloud Functions.
Make sure the Firebase CLI tool is set to use your Firebase project:
$ cd functions-samples/okta-auth
okta-auth$ firebase login
okta-auth$ firebase use <YOUR_FIREBASE_PROJECT_ID>
Optional: If you have configuration files from local testing, delete them:
okta-auth$ rm public/okta-config.js ; rm functions/.env ; rm .runtimeconfig.json
Run setup.js -d from the Firebase project directory. The -d flag
configures the web app and backend for deployment.
okta-auth$ node setup.js -d
The script will prompt you for some of your Okta and Firebase configuration values, create configurations files from them, and set some Cloud Funcions environment settings. The script won't overwrite existing files or Cloud Functions environment settings.
Deploy the project:
okta-auth$ firebase deploy
In the Google Cloud console:
api) to open the
Function Details page.Open the web app at: https://<YOUR_FIREBASE_PROJECT_ID>.web.app