This package provides an authentication strategy for integrating Okta with Remix applications through the `remix-auth` library. It extends the `OAuth2Strategy` to handle Okta's specific OAuth 2.0 and OpenID Connect flows, supporting both Node.js and Cloudflare runtimes. The current stable version is 1.2.0, with updates generally following `remix-auth`'s release cadence and Okta API changes. `remix-auth-okta` enables developers to quickly set up user authentication against an Okta account, managing the redirect to Okta for login and processing the callback. Its key differentiators include tight integration with the `remix-auth` ecosystem, offering a standardized approach to adding Okta authentication, and flexibility to support both Okta's hosted login page and custom login forms within the Remix application.
npm install remix-auth-oktaVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the core setup of `remix-auth-okta`. It initializes the `OktaStrategy` using environment variables for sensitive credentials, configures a basic `Authenticator` instance with a session storage, and defines the post-authentication callback to process user profile data from Okta.
Ensure the `callbackURL` in your Okta application settings precisely matches the `callbackURL` configured in your `OktaStrategy` instance and your Remix callback route (e.g., `/auth/okta/callback`). Pay attention to hostname, port, and scheme (HTTP/HTTPS).
Always consult the release notes for both `remix-auth` and `remix-auth-okta` when performing major version upgrades. Test authentication flows thoroughly after updates.
If `withCustomLoginForm` is enabled, verify that `oktaDomain` is correctly configured and that your Remix action handler for `/auth/okta` is designed to process the form data (email, password) and pass it to Okta's authentication API, rather than initiating a redirect to Okta's hosted login page.
Double-check that all required Okta credentials (`OKTA_ISSUER`, `OKTA_CLIENT_ID`, `OKTA_CLIENT_SECRET`) are correctly defined in your server's environment variables and that the Remix application can access them.
Verify `clientID` and `clientSecret` against your Okta application settings. Ensure the Okta application is configured as a 'Web' application and that the client credentials are valid.
Go to your Okta application settings and add or correct the 'Login redirect URIs' to precisely match the `callbackURL` specified in your `OktaStrategy` constructor.
Ensure `sessionStorage` is created using a server-side utility like `@remix-run/node`'s `createCookieSessionStorage` and correctly imported into `auth.server.ts`. It must include a `secrets` array for security.
Verify that the scopes configured in your Okta application (and potentially requested by the `OktaStrategy` if extended) include necessary profile scopes like `openid`, `profile`, `email`, etc., to allow access to user data.