Setting up Okta
eventcatalog@2.43.0
This guide takes your through setting up a protected sign-in screen for your docs. Before going through this guide, make sure you've first gone through Enabling authentication.
To setup your EventCatalog site with visitor authentication using Okta, the process looks as follows:
- Create a new Okta OAuth app
- Configure the OAuth app in EventCatalog
- Test the authentication
Create a new Okta OAuth app
First, you will need to create a new Okta OAuth app in your Okta Admin Console.
- Log in to your Okta Admin Console
- Navigate to Applications → Applications
- Click Create App Integration
- Select OIDC - OpenID Connect as the sign-in method
- Select Web Application as the application type
- Click Next
- Fill in the application details:
- App integration name:
EventCatalog
- Grant types: Check
Authorization Code
- Sign-in redirect URIs:
- Production:
{YOUR_EVENTCATALOG_SITE_URL}/api/auth/callback/okta
- Local development:
http://localhost:3000/api/auth/callback/okta
- Production:
- Sign-out redirect URIs:
- Production:
{YOUR_EVENTCATALOG_SITE_URL}
- Local development:
http://localhost:3000
- Production:
- App integration name:
- Under Assignments, choose who can access this application:
- Allow everyone in your organization to access (recommended)
- Or assign to specific groups
- Click Save
- Copy the Client ID and Client Secret from the app settings
- Note your Okta domain (e.g.,
https://your-domain.okta.com
)
Configure the OAuth app in EventCatalog
Add your Okta Client ID, Client Secret, and Issuer to your .env
file.
AUTH_OKTA_CLIENT_ID={YOUR_OKTA_CLIENT_ID}
AUTH_OKTA_CLIENT_SECRET={YOUR_OKTA_CLIENT_SECRET}
AUTH_OKTA_ISSUER=https://{YOUR_OKTA_DOMAIN}
Your Okta issuer URL should be in the format: https://your-domain.okta.com (without /oauth2/default unless you're using a custom authorization server). In your eventcatalog.auth.js file, add the following:
module.exports = {
providers: {
okta: {
clientId: process.env.AUTH_OKTA_CLIENT_ID,
clientSecret: process.env.AUTH_OKTA_CLIENT_SECRET,
issuer: process.env.AUTH_OKTA_ISSUER,
},
},
};
Test the authentication
Restart your EventCatalog server and test the authentication.
npm run dev
All pages should now be protected and require an Okta account to access.
- Navigate to your EventCatalog site
- You should be redirected to the sign-in page
- Click Sign in with Okta
- You'll be redirected to your Okta login page
- Enter your Okta credentials
- After successful authentication, you'll be redirected back to EventCatalog
Found an issue?
Remember to setup the prerequisites for this guide:
If you still have problems, please let us know.