@getomnico/okta-sso
v0.1.4
Published
Okta OIDC authentication for Omni using Arctic OAuth library
Maintainers
Readme
@getomnico/okta-sso
Okta OIDC authentication plugin for Omni. Adds "Sign in with Okta" support using PKCE-based OAuth 2.0.
Quick Start
Use the pre-built enterprise Docker image — no code changes needed:
# docker-compose.yml
services:
omni:
image: ghcr.io/getomnico/omni-web-enterprise:latestThen configure Okta SSO in Admin > Settings > Authentication — enter your Okta Domain, Client ID, Client Secret, and optionally an Authorization Server ID.
Building from Source
To build the enterprise image yourself, clone Omni and add this package to the web app before building:
git clone https://github.com/getomnico/omni.git
cd omni/web
npm install @getomnico/okta-sso
cd ../
docker build -t omni-web-enterprise .Package API
If you need to use the package directly:
npm install @getomnico/okta-ssoimport { OktaOAuthService } from "@getomnico/okta-sso";
const okta = new OktaOAuthService(
{
oktaDomain: "mycompany.okta.com",
clientId: "your-client-id",
clientSecret: "your-client-secret",
authorizationServerId: "default", // optional
},
"https://myapp.com/auth/okta/callback"
);
// 1. Create authorization URL
const { url, state, codeVerifier } = okta.createAuthorizationURL();
// Redirect user to `url`, store `state` and `codeVerifier` server-side
// 2. Exchange code for tokens (in callback handler)
const tokens = await okta.exchangeCodeForTokens(code, codeVerifier);
// 3. Fetch user profile
const profile = await okta.fetchUserProfile(tokens.access_token);
// { id, email, name, given_name, family_name, picture, email_verified, locale }Methods
| Method | Returns | Description |
|---|---|---|
| createAuthorizationURL() | { url, state, codeVerifier } | Generates Okta login URL with PKCE |
| exchangeCodeForTokens(code, codeVerifier) | Promise<OAuthTokens> | Exchanges auth code for tokens |
| fetchUserProfile(accessToken) | Promise<OAuthProfile> | Fetches user info from Okta |
License
See LICENSE.
