{"_id":"remix-auth-okta","_rev":"3-44e1549e87d0f2d1d3814f70e2ba4820","name":"remix-auth-okta","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"remix-auth-okta","version":"1.0.0","main":"./build/index.js","types":"./build/index.d.ts","scripts":{"build":"tsc --project tsconfig.json","typecheck":"tsc --project tsconfig.json --noEmit","lint":"eslint --ext .ts,.tsx src/","test":"jest --config=config/jest.config.ts --passWithNoTests","coverage":"npm run test -- --coverage"},"keywords":["remix","remix-auth","auth","authentication","strategy","okta"],"license":"MIT","peerDependencies":{"@remix-run/server-runtime":"^1.0.0"},"devDependencies":{"@babel/core":"^7.14.2","@babel/preset-env":"^7.14.1","@babel/preset-react":"^7.13.13","@babel/preset-typescript":"^7.13.0","@remix-run/node":"^1.0.3","@remix-run/react":"^1.1.1","@remix-run/server-runtime":"^1.0.0","@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.23.0","@typescript-eslint/parser":"^4.23.0","babel-jest":"^26.6.3","eslint":"^7.26.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-jest-dom":"^3.9.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-unicorn":"^32.0.1","jest":"^26.6.3","jest-fetch-mock":"^3.0.3","prettier":"^2.3.2","react":"^17.0.2","ts-node":"^9.1.1","typescript":"^4.3.5"},"dependencies":{"remix-auth":"^3.0.0","remix-auth-oauth2":"^1.2.0"},"gitHead":"9ced0c954dc8c2c44d9cb5592719a724f1f301f4","description":"The Okta strategy is used to authenticate users against an okta account. It extends the OAuth2Strategy.","_id":"remix-auth-okta@1.0.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-8SGUQETpIA7sNKQyAErTM5MtW2lHqzqHnIsDA7WZiQXk6EEmjSWqI5Jt8yBglM4TrYn6qa/C3IZEo66Nrw/25A==","shasum":"bfa519b26c9673aea306a7144cf6d5ea7c5f82cb","tarball":"https://registry.npmjs.org/remix-auth-okta/-/remix-auth-okta-1.0.0.tgz","fileCount":5,"unpackedSize":8341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAY2zCRA9TVsSAnZWagAASb8P/3wwKX99Lq3T7v15hcRG\nvho4d4YlAOEEXyg/LJUQ95zjdw5NKe9yPbemNK/rxLkUS6HNymdsgvYlYIWw\nYXasdzYlFNAuZOlm0S4+ndkjsE+j66IooMLkW5Mz4SwOfFColEfGyEo8+sem\nGkRsr0s6q2CtBIzfN+PKEwcdCdRnHY1IFIk59gK2K44ekSlHdUfob45cykMs\nCaAuc/3SxBapKVda6RiJxZ6UFnbGwSE4dn6uh/lgWwrtDof9nx/x3tn0Cnim\nPbvyCV+5YFSJgXqpYxk5vja2dy6aD/2tSPOEmlAqF2FzukojExRoEn1+/5T8\n66UuXMFiObIgpxlHRRI1beP5eo91ngwgNyWv6P4Nub39ov89xR9fChDQ5VKI\nyHpx1Wb1vfSVRYQdkUTdxOCVOQ7TiwgKhP+0msle3wtVfFiLlqm9WdC3r+dH\nn/NooaK6zxGJF2Ee3DhgAXwZhkLBZboijl73OmjI3AMH1lQdBhW5D1XLlljI\nAkip1zeXLN4prf1dSLYc7H+/GE+0eMUC7QoHIqH/7JtMJaqqKd5uX/wA3GX/\npmCrs+fyoH61sEl9QOPZM/QKsRwo45/NmwxECQKPyf+D24u6NVp0Zz2+1IXH\nTDp1E9XQ0ca0omBlzjgXWXCHpEiuSHPjoqfLS+UdrcglJdLo4hhfKPBA+i9E\ngl+6\r\n=VtD0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDLXxfRDPv57Fj2qJBrPNXq3yVs6p81wael/2JNk2i/bAiBLxor0oKQyKWtahN0PtpliIx9Rv27jbEePZQK5AvJyxA=="}]},"_npmUser":{"name":"jrakotoharisoa","email":"johann.rakotoharisoa@gmail.com"},"directories":{},"maintainers":[{"name":"jrakotoharisoa","email":"johann.rakotoharisoa@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remix-auth-okta_1.0.0_1644268978793_0.1628117412186536"},"_hasShrinkwrap":false},"1.1.0":{"name":"remix-auth-okta","version":"1.1.0","main":"./build/index.js","types":"./build/index.d.ts","scripts":{"build":"tsc --project tsconfig.json","typecheck":"tsc --project tsconfig.json --noEmit","lint":"eslint --ext .ts,.tsx src/","test":"jest --config=config/jest.config.ts --passWithNoTests","coverage":"npm run test -- --coverage"},"keywords":["remix","remix-auth","auth","authentication","strategy","okta"],"license":"MIT","peerDependencies":{"@remix-run/server-runtime":"^1.0.0"},"devDependencies":{"@babel/core":"^7.14.2","@babel/preset-env":"^7.14.1","@babel/preset-react":"^7.13.13","@babel/preset-typescript":"^7.13.0","@remix-run/node":"^1.0.3","@remix-run/react":"^1.1.1","@remix-run/server-runtime":"^1.0.0","@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.23.0","@typescript-eslint/parser":"^4.23.0","babel-jest":"^26.6.3","eslint":"^7.26.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-jest-dom":"^3.9.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-unicorn":"^32.0.1","jest":"^26.6.3","jest-fetch-mock":"^3.0.3","prettier":"^2.3.2","react":"^17.0.2","ts-node":"^9.1.1","typescript":"^4.3.5"},"dependencies":{"remix-auth":"^3.0.0","remix-auth-oauth2":"^1.2.0"},"gitHead":"79d5467a7f9b9496f5fae0ba7e36fba5fc0df2a9","description":"![CI](https://img.shields.io/github/workflow/status/jrakotoharisoa/remix-auth-okta/CI?style=flat-square) ![npm](https://img.shields.io/npm/v/remix-auth-okta?style=flat-square) # OktaStrategy","_id":"remix-auth-okta@1.1.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-RUEEfBJ0AMCZ0DmPr7PrYhgcvCoq52ucR6x8owWSJDcrUYijxkWWNGJYwEaghye5hDLv5HFnSALeG48QGQh9Qw==","shasum":"aa34f47cdf725ad5cdc6b7359c0c1d1743224057","tarball":"https://registry.npmjs.org/remix-auth-okta/-/remix-auth-okta-1.1.0.tgz","fileCount":5,"unpackedSize":13010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA4QSCRA9TVsSAnZWagAA12kP/1D1dF/QDlTMmB4v23mv\nKeDN8KwwOUAGX/LAwTHFqBl1OT5KENlnPYnvuSpSDG0ew18R+1UD4s9ljUlK\nXpEOPTIB6z6hCZ8/LccDgFjOWuiOaxgsSjAZWBR+l8/qXPXsDaqQk0xgoqnK\nNDssyHwpvXlMCICGJo/0H5LKU6p19Mfc6QPLoqMSHAxhDqERcHkaBmmcpcob\nlzuOAq/KmOWeh6tz+iTRfKHmZt33YljkqYAZ49ao9fMzphmOnazz6+AAs9mC\n8yytg4jhViwOp8j03X8NtYwnW+YZQxq7ng1sH7KjtFSRWtzLRE6YJU3YWs/p\nqbWgwoZXzPPuJJgF6YHxhPm34gMhks7qNgs90aLmAzuigCxM1NFa9vIwSPSf\nQ+l3hdsLppVepJPtjkT9gRAPQ+kt8vJL9u/UPpWF2Y+KqZzCn/u0tLhXjHgU\nTftAVuwLE6KeXbElFXG+y3fHDn/sCpeH4cuJRnBkuw2g9g1bgv/euqnKmeHs\nOv6XG8zm3FmvKaPWmYYowdj9KQu7IT76bK9mftGYmvoYWVVup73qghl1Kxhz\nI+ZrR5Scq5wB5XHW7kZ/XyB+LHxWSVDtUZQ9aoCAFlcPB3Cx1I2YxkLt50ax\nRqRL7fGGf7mmus4wa0yU7P0ACfWVm7UuuZtuJ9HNivKyJiMQsBRpPJoVWQrW\nnKyr\r\n=wHVX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChTpmh5G1qCsyVzsLLP0KFLGfWX9eezjv/bI/J8Lh4RQIhAMMGq1S474Vk4iWLMcuZCGJ9cqE+xULoE3fDvxfOvyT6"}]},"_npmUser":{"name":"jrakotoharisoa","email":"johann.rakotoharisoa@gmail.com"},"directories":{},"maintainers":[{"name":"jrakotoharisoa","email":"johann.rakotoharisoa@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remix-auth-okta_1.1.0_1644397586209_0.14908123070581714"},"_hasShrinkwrap":false},"1.2.0":{"name":"remix-auth-okta","version":"1.2.0","main":"./build/index.js","types":"./build/index.d.ts","scripts":{"build":"tsc --project tsconfig.json","typecheck":"tsc --project tsconfig.json --noEmit","lint":"eslint --ext .ts,.tsx src/","test":"jest --config=config/jest.config.ts --passWithNoTests","coverage":"npm run test -- --coverage"},"keywords":["remix","remix-auth","auth","authentication","strategy","okta"],"license":"MIT","peerDependencies":{"remix-auth":"^3.x"},"devDependencies":{"@babel/core":"^7.20.12","@babel/preset-env":"^7.20.2","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.18.6","@remix-run/node":"1.10.0","@remix-run/server-runtime":"1.10.0","@types/jest":"^29.2.5","@typescript-eslint/eslint-plugin":"^5.48.1","@typescript-eslint/parser":"^5.48.1","babel-jest":"^29.3.1","eslint":"^8.31.0","eslint-config-prettier":"^8.6.0","eslint-plugin-jest":"^27.2.1","eslint-plugin-jest-dom":"^4.0.3","eslint-plugin-prettier":"^4.2.1","eslint-plugin-unicorn":"^45.0.2","jest":"^29.3.1","jest-fetch-mock":"^3.0.3","prettier":"^2.8.2","react":"^17.x","ts-node":"^10.9.1","typescript":"^4.9.4"},"dependencies":{"remix-auth-oauth2":"^1.5.0"},"gitHead":"242a1f37f87da278790f039d7b51c01fcd985e79","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","_id":"remix-auth-okta@1.2.0","_nodeVersion":"14.21.1","_npmVersion":"6.14.17","dist":{"integrity":"sha512-vNVvacUl0SME7FpWWggHRgQOon37PNcWFKsq5dECtu6CcrF4UhIXN8pfP08BzcGymOb/25INIqFvYZ5kcqSpxw==","shasum":"973648d243b330537ceedcb9a624ef1a83d55659","tarball":"https://registry.npmjs.org/remix-auth-okta/-/remix-auth-okta-1.2.0.tgz","fileCount":5,"unpackedSize":13086,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDCTkZFTFiC31yKJcwPUQA4T//Crv190yZxi8pvmNZV3AiEA8qnQGlZJuUeQMiT2aEbESnu1AHDIsJ3cmF+Rt0JsY8M="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvugbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxEg//QU6jMKp/uYiugK5xVSCyan5pXRUzLzLoi7SRFVp6nSdYXmFM\r\nXhR7hE3i8XKD7aRBNgSu789Ep5CtoMDhfVkmCmv2kcbqMbeQpG1/SssERWtl\r\nIAYoE33rxUuTfhJuH96TOMEtJAdwT/+eXgGFoWODJYnNCsSn6H0iFWAsEiGb\r\npo8Lo7GJ4s/1yIDZqqs2G7T1aL1aJnrxOWvRvCFfW9RRlj5WrMjO6mnUVl7T\r\nJ5fksyUmJmSBtfp1zhGMbJDI7ZDEC61SSrUtK3Jv0TX0O3u6bgC+07a1Djgc\r\nAGxq/TgwZmePktCmw4IC9S0yY1d+Mb4ARIN3Xzj2+XC4Igq88KX5dE4kdW8v\r\nxP7gB+Jnp+mzDyNX321hX7/Hp4FLR7P+Qc62ds4OwXGbG1nkv6Yh4LizH7Ko\r\nB5JBjXUzKjOE84O5wAyp5Ze8s4EJkUF5Tl+fTqhHM5lcKsDRDQaqk1OIz0CS\r\no0ltgO89PMx0hMWZ0GYzaKiEna320/taKsia18QJbGkZhu5/i0jbojENh/UU\r\nkkgd5G3C8Mchl7nCDW68YLk4kuI7qIUxxd11wgz8rk1xAJm2SgyKx9p//fr7\r\n8w4KH2kaRAKCbIDvtwxJOmV0e+QTAgeJ+voHGFoIKLNC3qjfP2m7dMmTvz3H\r\nLwQ+UHNZiajloetDjfgeMAX+pguq66TTyCw=\r\n=aEaj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jrakotoharisoa","email":"johann.rakotoharisoa@gmail.com"},"directories":{},"maintainers":[{"name":"jrakotoharisoa","email":"johann.rakotoharisoa@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remix-auth-okta_1.2.0_1673455642983_0.4455000612082314"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-07T21:22:58.736Z","1.0.0":"2022-02-07T21:22:59.002Z","modified":"2023-01-11T16:47:23.227Z","1.1.0":"2022-02-09T09:06:26.357Z","1.2.0":"2023-01-11T16:47:23.141Z"},"maintainers":[{"name":"jrakotoharisoa","email":"johann.rakotoharisoa@gmail.com"}],"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","keywords":["remix","remix-auth","auth","authentication","strategy","okta"],"license":"MIT","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## Supported runtimes\n\n| Runtime    | Has Support |\n| ---------- | ----------- |\n| Node.js    | ✅          |\n| Cloudflare | ✅          |\n\n<!-- If it doesn't support one runtime, explain here why -->\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\";\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(\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    callbackURL: \"https://your-app-domain.com/auth/okta/callback\",\n  },\n  async ({ accessToken, refreshToken, extraParams, profile }) => {\n    // Get the user data from your DB or API using the tokens and profile\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\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  return authenticator.authenticate(\"okta\", request, {\n    successRedirect: \"/private\",\n    failureRedirect: \"/login\",\n  });\n};\n\n```\n\n## How to use with custom login page\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\";\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(\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    callbackURL: \"https://your-app-domain.com/auth/okta/callback\",\n\n    // Add this to options for custom login form\n    withCustomLoginForm: true,\n    // example of okta domain: https://dev-1234.okta.com\n    oktaDomain: \"YOUR_OKTA_DOMAIN\"\n  },\n  async ({ accessToken, refreshToken, extraParams, profile }) => {\n    // Get the user data from your DB or API using the tokens and profile\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      <input type=\"text\" name=\"email\"/>\n      <input type=\"password\" name=\"password\"/>\n      <button>Log in</button>\n    </Form>\n  );\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  return authenticator.authenticate(\"okta\", request, {\n    successRedirect: \"/private\",\n    failureRedirect: \"/login\",\n  });\n};\n\n```\n","readmeFilename":"README.md"}