{"_id":"@curvenote/remix-auth-okta","_rev":"2-b8122708b51be8874765874df4925c6f","name":"@curvenote/remix-auth-okta","dist-tags":{"latest":"3.0.0"},"versions":{"2.0.0":{"name":"@curvenote/remix-auth-okta","version":"2.0.0","keywords":["remix","remix-auth","auth","authentication","strategy","okta"],"author":{"name":"Steve Purves","email":"steve@curvenote.com"},"license":"MIT","_id":"@curvenote/remix-auth-okta@2.0.0","maintainers":[{"name":"fwkoch","email":"franklinwkoch@gmail.com"},{"name":"rowanc1","email":"rowanc1@gmail.com"},{"name":"stevejpurves","email":"stevejpurves@gmail.com"}],"contributors":[{"name":"Johann Rakotoharisoa"}],"homepage":"https://github.com/curvenote/remix-auth-okta#readme","bugs":{"url":"https://github.com/curvenote/remix-auth-okta/issues"},"dist":{"shasum":"ba23406bbc4b280b8006f827d4be63de0d6655d8","tarball":"https://registry.npmjs.org/@curvenote/remix-auth-okta/-/remix-auth-okta-2.0.0.tgz","fileCount":9,"integrity":"sha512-7++4TREFjl9w/vQ4B8dc08Sq2fS0RnJJmVHEegVpD5t2UJPrqES6qAUvFkGHZXQxTxkfOHFq4iHJ7LZEuDhBZw==","signatures":[{"sig":"MEUCIEq1DoqUFw5EU4CE7AlAdonQ33aFO1KDHf6yifyW2/llAiEAkus4yM8oWMByUP2OB8I8mjdiTzcQDGBNA1YD2t61MY0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11801},"main":"./build/index.js","type":"module","types":"./build/index.d.ts","gitHead":"5eff6e02e32a617bc9ebc4706adcc38df4c7cbc2","scripts":{"dev":"tsc --project tsconfig.json --watch","lint":"eslint --ext .ts,.tsx src/","test":"jest --config=config/jest.config.ts --passWithNoTests","build":"tsc --project tsconfig.json","version":"npm install; npm run build; npx changeset version","coverage":"npm run test -- --coverage","typecheck":"tsc --project tsconfig.json --noEmit"},"_npmUser":{"name":"stevejpurves","email":"stevejpurves@gmail.com"},"repository":{"url":"git+https://github.com/curvenote/remix-auth-okta.git","type":"git"},"_npmVersion":"10.9.0","description":"![CI](https://img.shields.io/github/actions/workflow/status/jrakotoharisoa/remix-auth-okta/main.yml?branch=main&style=flat-square) ![npm](https://img.shields.io/npm/v/remix-auth-okta?style=flat-square) # OktaStrategy","directories":{},"sideEffects":false,"_nodeVersion":"22.11.0","dependencies":{"jsonwebtoken":"^9.0.2","@changesets/cli":"^2.27.12","remix-auth-oauth2":"^3.2.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.31.0","ts-node":"^10.9.2","prettier":"^2.8.2","remix-auth":"^4.1.0","typescript":"^5.6.3","@types/jsonwebtoken":"^9.0.8","eslint-plugin-unicorn":"^45.0.2","eslint-config-prettier":"^8.6.0","eslint-plugin-prettier":"^4.2.1","@typescript-eslint/parser":"^5.48.1","@typescript-eslint/eslint-plugin":"^5.48.1"},"peerDependencies":{"remix-auth":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/remix-auth-okta_2.0.0_1738789701469_0.6349280001286273","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"@curvenote/remix-auth-okta","version":"3.0.0","main":"./build/index.js","types":"./build/index.d.ts","sideEffects":false,"type":"module","scripts":{"build":"tsc --project tsconfig.json","dev":"tsc --project tsconfig.json --watch","typecheck":"tsc --project tsconfig.json --noEmit","lint":"eslint --ext .ts,.tsx src/","test":"vitest","coverage":"vitest run --coverage","version":"npm install; npm run build; npx changeset version","publish":"npm run build; npx changeset publish"},"keywords":["remix","remix-auth","auth","authentication","strategy","okta"],"license":"MIT","contributors":[{"name":"Johann Rakotoharisoa"}],"author":{"name":"Steve Purves","email":"steve@curvenote.com"},"repository":{"url":"git+https://github.com/curvenote/remix-auth-okta.git","type":"git"},"peerDependencies":{"remix-auth":"^4.1.0"},"devDependencies":{"@remix-run/node":"^2.16.8","@types/jsonwebtoken":"^9.0.8","@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","@vitest/coverage-v8":"^1.3.1","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-unicorn":"^51.0.1","prettier":"^3.2.5","remix-auth":"^4.1.0","ts-node":"^10.9.2","typescript":"^5.6.3","vitest":"^1.3.1"},"dependencies":{"@changesets/cli":"^2.27.12","jsonwebtoken":"^9.0.2","remix-auth-oauth2":"^3.2.2"},"publishConfig":{"access":"public"},"_id":"@curvenote/remix-auth-okta@3.0.0","gitHead":"b89caf583a6e511864b298e7333e97ffd8107681","description":"![CI](https://img.shields.io/github/actions/workflow/status/jrakotoharisoa/remix-auth-okta/main.yml?branch=main&style=flat-square) ![npm](https://img.shields.io/npm/v/remix-auth-okta?style=flat-square) # OktaStrategy","bugs":{"url":"https://github.com/curvenote/remix-auth-okta/issues"},"homepage":"https://github.com/curvenote/remix-auth-okta#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-XBPlcGInzyMwNQZgtzS1kumXIsExHiD0+lbgijXElJ8slXhylEGkMNsleRHMWuCVC/ov/tSUG6A8vtiinhURtQ==","shasum":"543d913baf0e5f9fc18ca8b4de3959a032353fda","tarball":"https://registry.npmjs.org/@curvenote/remix-auth-okta/-/remix-auth-okta-3.0.0.tgz","fileCount":9,"unpackedSize":12499,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC56qdDR2MdpFF8u2W5h3ret5UR0eTJeCy0NG59iCnfJwIhAJrbSfST/ScEY5t42ynj6JjbgHKx0gclf4n3DnQQm8CU"}]},"_npmUser":{"name":"stevejpurves","email":"stevejpurves@gmail.com"},"directories":{},"maintainers":[{"name":"fwkoch","email":"franklinwkoch@gmail.com"},{"name":"rowanc1","email":"rowanc1@gmail.com"},{"name":"stevejpurves","email":"stevejpurves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remix-auth-okta_3.0.0_1749725826120_0.42029299655663555"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-05T21:08:21.362Z","modified":"2025-06-12T10:57:06.637Z","2.0.0":"2025-02-05T21:08:21.649Z","3.0.0":"2025-06-12T10:57:06.431Z"},"bugs":{"url":"https://github.com/curvenote/remix-auth-okta/issues"},"author":{"name":"Steve Purves","email":"steve@curvenote.com"},"license":"MIT","homepage":"https://github.com/curvenote/remix-auth-okta#readme","keywords":["remix","remix-auth","auth","authentication","strategy","okta"],"repository":{"url":"git+https://github.com/curvenote/remix-auth-okta.git","type":"git"},"description":"![CI](https://img.shields.io/github/actions/workflow/status/jrakotoharisoa/remix-auth-okta/main.yml?branch=main&style=flat-square) ![npm](https://img.shields.io/npm/v/remix-auth-okta?style=flat-square) # OktaStrategy","contributors":[{"name":"Johann Rakotoharisoa"}],"maintainers":[{"name":"fwkoch","email":"franklinwkoch@gmail.com"},{"name":"rowanc1","email":"rowanc1@gmail.com"},{"name":"stevejpurves","email":"stevejpurves@gmail.com"}],"readme":"![CI](https://img.shields.io/github/actions/workflow/status/jrakotoharisoa/remix-auth-okta/main.yml?branch=main&style=flat-square)\n![npm](https://img.shields.io/npm/v/remix-auth-okta?style=flat-square)\n# OktaStrategy\n\nThe Okta strategy is used to authenticate users against an okta account. It extends the OAuth2Strategy.\n\n## Prerequisites\n### Create an Okta Web app\n\nFollow the steps on [the Okta documentation](https://developer.okta.com/docs/guides/sign-into-web-app/nodeexpress/main/#understand-the-callback-route) to create Okta web app and get client ID, client secret and issuer\n\n## How to use\n\n#### Create the strategy instance\n\n```typescript\n// app/utils/auth.server.ts\nimport { Authenticator } from \"remix-auth\";\nimport { OktaStrategy } from \"remix-auth-okta\";\nimport type { OktaProfile } from \"remix-auth-okta\";\n\ntype User = {\n  id: string;\n  profile: OktaProfile;\n}\n\n// Create an instance of the authenticator, pass a generic with what your\n// strategies will return and will be stored in the session\nexport const authenticator = new Authenticator<User>(sessionStorage);\n\nlet oktaStrategy = new OktaStrategy<User>(\n  {\n    // example of issuer: https://dev-1234.okta.com/oauth2/default\n    issuer: \"YOUR_OKTA_ISSUER\", \n    clientId: \"YOUR_OKTA_CLIENT_ID\",\n    clientSecret: \"YOUR_OKTA_CLIENT_SECRET\",\n    redirectURI: \"https://your-app-domain.com/auth/okta/callback\",\n  },\n  async ({ tokens }) => {\n    const { id_token, access_token } = tokens.data as { id_token: string; access_token: string };\n    const idClaims = jwt.decode(id_token) as OktaIdTokenClaims;\n    // check idClaims.exp\n    const profile = await OktaStrategy.userProfile(access_token);\n\n    // Get/verify the user data\n    return User.findOrCreate({ email: profile.email });\n  }\n);\n\nauthenticator.use(oktaStrategy);\n```\n\n### Setup your routes\n\n```typescript\n// app/routes/login.tsx\nexport default function Login() {\n  return (\n    <Form action=\"/auth/okta\" method=\"post\">\n      <button>Login with Okta</button>\n    </Form>\n  );\n}\n```\n\n```typescript\n// app/routes/auth/okta.tsx\nimport type { ActionFunction, LoaderFunction } from \"remix\";\n\nimport { authenticator } from \"~/utils/auth.server\";\n\nexport let loader: LoaderFunction = () => redirect(\"/login\");\n\nexport let action: ActionFunction = ({ request }) => {\n  return authenticator.authenticate(\"okta\", request);\n};\n\n```\n\n```typescript\n// app/routes/auth/okta/callback.tsx\nimport type { ActionFunction, LoaderFunction } from \"remix\";\n\nimport { authenticator } from \"~/utils/auth.server\";\n\nexport let loader: LoaderFunction = ({ request }) => {\n  const user = await authenticator.authenticate('okta', request);\n  if (!user) {\n    throw redirect('/login');\n  }\n\n  const session = await sessionStorage.getSession(request.headers.get('Cookie'));\n  session.set('user', user);\n\n  return redirect('/success', {\n    headers: { 'Set-Cookie': await sessionStorage.commitSession(session) },\n  });\n};\n```\n\n## Forked\n\nThis strategy was originally forked from [jrakotoharisoa/remix-auth-okta](https://github.com/jrakotoharisoa/remix-auth-okta)  but since modified to use the `remix-auth@4.*` and \ntrimming back to drop the form based logins.\n* [Original MIT license](https://github.com/jrakotoharisoa/remix-auth-okta)\n* Forked at [242a1f3](https://github.com/jrakotoharisoa/remix-auth-okta/commit/242a1f37f87da278790f039d7b51c01fcd985e79)","readmeFilename":"README.md"}