RobertBrewitz / dapr-okta-node

Somewhat rudimentary Dapr setup with Okta oauth2 Client Credentials Flow. Auth in frontend, verify token in Dapr middleware. Decode JWT in node for sub (Okta App userID)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dapr Example

Requirements

How to run locally

Backend

Setup

  1. Sign in to your Okta developer dashboard and navigate to Applications > Add Application.
  2. Choose Web and click Next.
  3. Set all URLs to http://localhost:8080
  4. Check the box Client Credentials and click Done
  5. Copy the Client ID and replace ${yourClientId} in backend/components/okta.yaml.
  6. Copy the Okta domain and replace ${yourOktaDomain} in backend/components/okta.yaml.
  7. Go to API > Authroization Servers > default > Scopes.
  8. Create a new scope named yourOwnScope, it has to match the scope in backend/components/okta.yaml; You only need to choose a name and click Create.

yourOwnScope you can name the scope whatever.

cd backend
npm i
npm start

Frontend

Setup

  1. Sign in to your Okta developer dashboard and navigate to Applications > Add Application.
  2. Choose Single-Page App and click Next.
  3. Set http://localhost:8080 as a Login redirect URI and click Done.
  4. Copy the Client ID and replace ${yourClientId} in frontend/index.html.
  5. Copy the Okta domain and replace ${yourOktaDomain} in frontend/index.html.

Start Frontend

cd frontend
npm i
npm start

Open up your browser, login to Okta

localhost:8080

License

ICS License

About

Somewhat rudimentary Dapr setup with Okta oauth2 Client Credentials Flow. Auth in frontend, verify token in Dapr middleware. Decode JWT in node for sub (Okta App userID)

License:ISC License


Languages

Language:HTML 60.3%Language:TypeScript 29.7%Language:Dockerfile 8.1%Language:JavaScript 1.9%