{"_id":"@boxyhq/remix-auth-sso","_rev":"6-418a6284964c5b5e9747a818c18a5e8a","name":"@boxyhq/remix-auth-sso","dist-tags":{"latest":"1.1.1"},"versions":{"1.1.0":{"name":"@boxyhq/remix-auth-sso","version":"1.1.0","keywords":["remix","remix-auth","auth","authentication","strategy","saml2","oauth2","openid-connect"],"author":{"url":"https://boxyhq.com","name":"BoxyHQ","email":"aswin@boxyhq.com"},"license":"MIT","_id":"@boxyhq/remix-auth-sso@1.1.0","maintainers":[{"name":"deepakp","email":"deepak@boxyhq.com"}],"homepage":"https://github.com/boxyhq/remix-auth-sso#readme","bugs":{"url":"https://github.com/boxyhq/remix-auth-sso/issues"},"dist":{"shasum":"11ca43f6fa833d01703a8b763d040c1af7188f8d","tarball":"https://registry.npmjs.org/@boxyhq/remix-auth-sso/-/remix-auth-sso-1.1.0.tgz","fileCount":5,"integrity":"sha512-wMPEBq68h/rBMhQ/bpyHbjZjxRpDfOAWu0CzG9AU2SfZ2ONRqDPQedIaom38mcw/R5hCR3qiCSmkPQpoIUnODw==","signatures":[{"sig":"MEUCIQDEJcGIduS85V2jIahQoxT3LOHtn8qHgmHPQotv4gvfhQIgXSzGYzwYcoN90SJKToqUUaQ62/c9x4pia/O32mzjjbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ/cSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHJhAAhXQuacQBX6NLfFV66Sk9ytsY5XntRYiXHcKPal7JfUhpZlrm\r\nGX9UIJ5MbNrBO4LsWs3o2MBImo83r9grQKNjQquY5QdrPaY/yiR/cgizm43V\r\n9amXGEm1gdXe2ws9hJgCfqIf29wzMeTOBA8N8CNG/CXVNiajBg1puyjUPnFe\r\nig9pVuuUQWZdY76lFQ6JspPTMk9ao6OFBQFWkkOcdMAL8ovjNwno0dGsfgby\r\nggToHMNVHiwXYswue73e2KeLlxyX/B3uRC6TH2P91+AmoSiti17vubpIdYJM\r\n8Nq9tiKXdfpnGY2DaNyEXqC6WQLSUfUa9DGp2XvA5/muMHjB3406TQ/wQN5w\r\nNltTTfXfjWZtLsEbx6VurmcNgZQYMUs6uogU07JpzFuZEvR9EykKYVGakB0j\r\n9r79YxA8r3R0Gmdyzxc3ibpbvkU09ZS7meWOj5ocNjN+zqNjJAfC7g8i3v6v\r\nclhzPKZOBgCxUHkDOT/3P9ehTd5s3DyG2XBfMCKLFp5I0l4nbK3SyDPGsflW\r\njGJucc7+fdD7Fz2jmHaqqmnSTPEzeos8nFfbXfMtlHFm0O5jO6wH+OpAwCGL\r\nt7JDVzPCP365n2qipjADPHcXgCPm1T6oHUSenhEVk05Kk1n3Y2Omh5YadILA\r\nXKfHKrUhQ3KxfZ+E+BDZ+Qw6RWasFIMliYE=\r\n=hAo3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./build/index.js","types":"./build/index.d.ts","gitHead":"67f89fe917d2ebe34711ceda7c4b0c52a4bedb31","scripts":{"lint":"eslint --ext .ts,.tsx src/","test":"jest --config=config/jest.config.ts --passWithNoTests","build":"tsc --project tsconfig.json","coverage":"npm run test -- --coverage","typecheck":"tsc --project tsconfig.json --noEmit"},"_npmUser":{"name":"deepakp","email":"deepak@boxyhq.com"},"repository":{"url":"git+https://github.com/boxyhq/remix-auth-sso.git","type":"git"},"_npmVersion":"8.15.0","description":"An SSO strategy for Remix Auth, based on the OAuth2Strategy","directories":{},"_nodeVersion":"16.17.1","dependencies":{"remix-auth":"^3.0.0","remix-auth-oauth2":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","react":"^17.0.2","eslint":"^7.26.0","ts-node":"^9.1.1","prettier":"^2.3.2","babel-jest":"^26.6.3","typescript":"^4.3.5","@babel/core":"^7.14.2","@types/jest":"^26.0.23","@remix-run/node":"^1.0.3","jest-fetch-mock":"^3.0.3","@remix-run/react":"^1.1.1","@babel/preset-env":"^7.14.1","eslint-plugin-jest":"^24.3.6","@babel/preset-react":"^7.13.13","eslint-plugin-unicorn":"^32.0.1","eslint-config-prettier":"^8.3.0","eslint-plugin-jest-dom":"^3.9.0","eslint-plugin-prettier":"^3.4.0","@babel/preset-typescript":"^7.13.0","@remix-run/server-runtime":"^1.0.0","@typescript-eslint/parser":"^4.23.0","@typescript-eslint/eslint-plugin":"^4.23.0"},"peerDependencies":{"@remix-run/server-runtime":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remix-auth-sso_1.1.0_1665398546026_0.1835280408360338","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@boxyhq/remix-auth-sso","version":"1.1.1","keywords":["remix","remix-auth","auth","authentication","strategy","saml2","oauth2","openid-connect"],"author":{"url":"https://boxyhq.com","name":"BoxyHQ","email":"aswin@boxyhq.com"},"license":"Apache-2.0","_id":"@boxyhq/remix-auth-sso@1.1.1","maintainers":[{"name":"deepakp","email":"deepak@boxyhq.com"}],"homepage":"https://github.com/boxyhq/remix-auth-sso#readme","bugs":{"url":"https://github.com/boxyhq/remix-auth-sso/issues"},"dist":{"shasum":"8b15780bd9f3657c2cfe01ab01f3c8bbee2a79a5","tarball":"https://registry.npmjs.org/@boxyhq/remix-auth-sso/-/remix-auth-sso-1.1.1.tgz","fileCount":5,"integrity":"sha512-TMYH0r2u7GdDO1IWZRVzsKENjQoqrjN3up9VeOQPluyIkemENCfEFgheKJeOI6mo0eSeWWEjtsoKVd6S+4EYdw==","signatures":[{"sig":"MEUCIE+MqVHbG8QgaOc+cgbIDxHWZDOI7VnnvP53BKFsVNKqAiEAsnSUAmlZuzQMfafiNOIiSGuj43Id7kr2rd4UAbrdSkU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjz84iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrnYg/+MYOUaAP6FGDlcy9+CMH2F9LOr1Ss9Y+j+5yOSUN2CmxfrKLh\r\nXKHpXsm5rM67+KrF9KoSnT3XrqLvPDWF545lDH9dPyxMRcN77NEyNAI8dN2e\r\nvFUcF4Q0RyShN1gNNx1JZ3DcH3LISqj9+kKc0gEXzMkZI/lLrYrQpKTvP93f\r\nLRlkp8XnPtwRjGW24zLt5dMnMsdre13XDMiICcen3qLaGwFBfr/9Bi2WnXD7\r\nGaitHIYyBQwgy3UhbhkU/9etKBwEIqwrSqCINsThwEqvOCq/G2KUxeKfkBeo\r\nuUWale27YsbrBb2cBhP0M9sO0IP1aCvnUIP6S/mk0xjEz85DUMfd2NwUScZX\r\n0Gn1WG0hcpdeMXPLFHGpOwxkcXDHSByaSjgecoUu2jS4ydU9f5T0sbAlIx5B\r\nIQ9MdHrMOUiFPb9J1f1gtI1mB3XamusPDzvKislJTeU8cBTIv5KTXbMg6W7b\r\nd/Y6QdwZ8NGQvEcNXtfql4tyMTkM3rxF3YkGtNI/U5q53fTBbq71BqZNxJI+\r\nyIlSi3y85Gj+P3Lp2+u5K4NZ+dIpChXCyYnlteddBDNbw6RbZ8MdjPqB7n0f\r\nY5Vc/YIOzE5wLce3sw+QQSABga5xpyYs/6raXyY9c6uptJPWQEyXAr8rf08r\r\nhQNqZpj8Q6t+Qgmv6erVixf+KX56VKuAQKQ=\r\n=ZTWt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./build/index.js","types":"./build/index.d.ts","gitHead":"77da23f5e98c97136fd197356fa985f1dd3837e5","scripts":{"lint":"eslint --ext .ts,.tsx src/","test":"jest --config=config/jest.config.ts --passWithNoTests","build":"tsc --project tsconfig.json","coverage":"npm run test -- --coverage","typecheck":"tsc --project tsconfig.json --noEmit"},"_npmUser":{"name":"deepakp","email":"deepak@boxyhq.com"},"repository":{"url":"git+https://github.com/boxyhq/remix-auth-sso.git","type":"git"},"_npmVersion":"8.19.3","description":"An SSO strategy for Remix Auth, based on the OAuth2Strategy","directories":{},"_nodeVersion":"16.19.0","dependencies":{"remix-auth":"^3.0.0","remix-auth-oauth2":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","react":"^17.0.2","eslint":"^7.26.0","ts-node":"^9.1.1","prettier":"^2.3.2","babel-jest":"^26.6.3","typescript":"^4.3.5","@babel/core":"^7.14.2","@types/jest":"^26.0.23","@remix-run/node":"^1.0.3","jest-fetch-mock":"^3.0.3","@remix-run/react":"^1.1.1","@babel/preset-env":"^7.14.1","eslint-plugin-jest":"^24.3.6","@babel/preset-react":"^7.13.13","eslint-plugin-unicorn":"^32.0.1","eslint-config-prettier":"^8.3.0","eslint-plugin-jest-dom":"^3.9.0","eslint-plugin-prettier":"^3.4.0","@babel/preset-typescript":"^7.13.0","@remix-run/server-runtime":"^1.0.0","@typescript-eslint/parser":"^4.23.0","@typescript-eslint/eslint-plugin":"^4.23.0"},"peerDependencies":{"@remix-run/server-runtime":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remix-auth-sso_1.1.1_1674563106603_0.7135613336339921","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-10-10T10:42:25.936Z","modified":"2026-03-20T16:41:28.400Z","1.1.0":"2022-10-10T10:42:26.178Z","1.1.1":"2023-01-24T12:25:06.777Z"},"bugs":{"url":"https://github.com/boxyhq/remix-auth-sso/issues"},"author":{"url":"https://boxyhq.com","name":"BoxyHQ","email":"aswin@boxyhq.com"},"license":"Apache-2.0","homepage":"https://github.com/boxyhq/remix-auth-sso#readme","keywords":["remix","remix-auth","auth","authentication","strategy","saml2","oauth2","openid-connect"],"repository":{"url":"git+https://github.com/boxyhq/remix-auth-sso.git","type":"git"},"description":"An SSO strategy for Remix Auth, based on the OAuth2Strategy","maintainers":[{"email":"deepak@boxyhq.com","name":"deepakp"},{"email":"aswin@boxyhq.com","name":"aswin_boxyhq"}],"readme":"# BoxyHQSSOStrategy\n\n**Attention ⚠️**: We have deprecated the earlier strategy `BoxyHQSAMLStrategy` (npm package: `@boxyhq/remix-auth-saml`). In case you are using that one please consider changing over to this strategy.\n\nThe BoxyHQSSOStrategy can be used to enable Single Sign-On (SSO) in your remix app. It extends the OAuth2Strategy.\n\n# Demo\n\nCheckout the demo at https://github.com/boxyhq/jackson-remix-auth\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\n## SAML Jackson Service\n\nSAML Jackson implements SSO as an OAuth 2.0 flow, abstracting away all the complexities of the underlying SAML/OIDC protocol.\n\nYou can deploy SAML Jackson as a separate service. [Check out the documentation for more details](https://boxyhq.com/docs/jackson/deploy)\n\n## Configuration\n\nSSO login requires a connection for every tenant/product of yours. One common method is to use the domain for an email address to figure out which tenant they belong to. You can also use a unique tenant ID (string) from your backend for this, typically some kind of account or organization ID.\n\nCheck out the [documentation](https://boxyhq.com/docs/jackson/sso-flow/#21-add-connection) for more details.\n\n## Usage\n\n### Install the strategy\n\n```bash\nnpm install @boxyhq/remix-auth-sso\n```\n\n### Create the strategy instance\n\n```ts\n// app/utils/auth.server.ts\nimport { Authenticator } from \"remix-auth\";\nimport {\n  BoxyHQSSOStrategy,\n  type BoxyHQSSOProfile,\n} from \"@boxyhq/remix-auth-sso\";\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<BoxyHQSSOProfile>(\n  sessionStorage\n);\n\nauth.use(\n  new BoxyHQSSOStrategy(\n    {\n      issuer: \"http://localhost:5225\", // point this to the hosted jackson service\n      clientID: \"dummy\", // The dummy here is necessary if the tenant and product are set dynamically from the client side\n      clientSecret: \"dummy\", // The dummy here is necessary if the tenant and product are set dynamically from the client side\n      callbackURL: new URL(\n        \"/auth/sso/callback\",\n        process.env.BASE_URL\n      ).toString(), // BASE_URL should point to the application URL\n    },\n    async ({ profile }) => {\n      return profile;\n    }\n  )\n);\n```\n\n### Setup your routes\n\n```tsx\n// app/routes/login.tsx\nexport default function Login() {\n  return (\n    <Form method=\"post\" action=\"/auth/sso\">\n      {/* We will be using user email to identify the tenant*/}\n      <label htmlFor=\"email\">Email</label>\n      <input\n        id=\"email\"\n        type=\"email\"\n        name=\"email\"\n        placeholder=\"johndoe@example.com\"\n        required\n      />\n      {/* Product can also be set dynamically, set to `demo` here */}\n      <input type=\"text\" name=\"product\" hidden defaultValue=\"demo\" />\n      <button type=\"submit\">Sign In with SSO</button>\n    </Form>\n  );\n}\n```\n\n```tsx\n// app/routes/auth/sso.tsx\nimport { ActionFunction, json } from \"remix\";\nimport { auth } from \"~/auth.server\";\nimport invariant from \"tiny-invariant\";\n\ntype PostError = {\n  email?: boolean;\n  product?: boolean;\n};\nexport const action: ActionFunction = async ({ request }) => {\n  const formData = await request.formData();\n\n  const email = formData.get(\"email\");\n  const product = await formData.get(\"product\");\n\n  const errors: PostError = {};\n  if (!email) errors.email = true;\n  if (!product) errors.product = true;\n\n  if (Object.keys(errors).length) {\n    return json(errors);\n  }\n\n  invariant(typeof email === \"string\");\n  // Get the tenant from the domain\n  const tenant = email.split(\"@\")[1];\n  return await auth.authenticate(\"boxyhq-sso\", request, {\n    successRedirect: \"/private\",\n    failureRedirect: \"/\",\n    context: {\n      clientID: `tenant=${tenant}&product=${product}`,\n      clientSecret: \"dummy\",\n    },\n  });\n};\n```\n\n```tsx\n// app/routes/auth/sso/callback.tsx\nimport type { LoaderFunction } from \"remix\";\nimport { auth } from \"~/auth.server\";\n\nexport const loader: LoaderFunction = async ({ request, params }) => {\n  return auth.authenticate(\"boxyhq-sso\", request, {\n    successRedirect: \"/private\",\n    failureRedirect: \"/\",\n  });\n};\n```\n","readmeFilename":"README.md"}