{"_id":"@asgardeo/remix-auth-asgardeo","_rev":"2-19a2734b1c18ff2a1322997d1e98b549","name":"@asgardeo/remix-auth-asgardeo","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.0":{"name":"@asgardeo/remix-auth-asgardeo","version":"0.0.0","keywords":["remix","remix-auth","auth","authentication","strategy","asgardeo"],"author":{"name":"WSO2"},"license":"Apache-2.0","_id":"@asgardeo/remix-auth-asgardeo@0.0.0","maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"homepage":"https://github.com/asgardeo/remix-auth-asgardeo#readme","bugs":{"url":"https://github.com/asgardeo/remix-auth-asgardeo/issues"},"nx":{"includedScripts":["build","lint","test","typecheck"]},"dist":{"shasum":"0a766fda4cadb8758565ce886b2c05b9b8f758f8","tarball":"https://registry.npmjs.org/@asgardeo/remix-auth-asgardeo/-/remix-auth-asgardeo-0.0.0.tgz","fileCount":2,"integrity":"sha512-FvBo1AvQeo7k1oz9zd+16vdJmdqFLCL5qN3kp7WIjguya4T0F5DeoLvf18lUmdeBzoDn8t8mOBWUMsbNELxRaw==","signatures":[{"sig":"MEUCIFTO7/7+ki6O4XRiHeyoX3X9q2W0Mk7P4VnBaKXwYn1DAiEAguiwflYpZIrQ4vETHKnuIKk/16G9prW3e7sCFyZltwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13739},"main":"./build/index.js","_from":"file:asgardeo-remix-auth-asgardeo-0.0.0.tgz","types":"./build/index.d.ts","scripts":{"lint":"eslint .","test":"jest --config=config/jest.config.ts --passWithNoTests","build":"tsc --project tsconfig.lib.json","test:ci":"pnpm jest --passWithNoTests --coverage","lint:fix":"eslint . --fix","typecheck":"tsc --project tsconfig.json --noEmit"},"_npmUser":{"name":"wso2-org","email":"techops@wso2.com"},"_resolved":"/tmp/920101ca339b5fdaf34373058fbb9d3b/asgardeo-remix-auth-asgardeo-0.0.0.tgz","_integrity":"sha512-FvBo1AvQeo7k1oz9zd+16vdJmdqFLCL5qN3kp7WIjguya4T0F5DeoLvf18lUmdeBzoDn8t8mOBWUMsbNELxRaw==","repository":{"url":"git+https://github.com/asgardeo/remix-auth-asgardeo.git","type":"git","directory":"lib"},"_npmVersion":"10.9.0","description":"An Asgardeo Strategy for Remix Auth, based on the OAuth2Strategy","directories":{},"_nodeVersion":"22.12.0","dependencies":{"remix-auth-oauth2":"1.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"29.7.0","react":"^18.2.0","eslint":"~8.57.0","ts-node":"10.9.1","prettier":"^3.4.2","babel-jest":"29.7.0","typescript":"5.2.2","@babel/core":"7.23.2","@jest/types":"^29.6.3","@types/jest":"29.5.5","@types/node":"^22.10.1","@jest/globals":"^29.7.0","@remix-run/node":"2.1.0","jest-fetch-mock":"3.0.3","@remix-run/react":"2.1.0","@babel/preset-env":"7.23.2","@babel/preset-react":"7.22.15","@wso2/eslint-plugin":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?fa0b844715320a3953d6d055997c0770f8695082","@wso2/prettier-config":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?fa0b844715320a3953d6d055997c0770f8695082","eslint-plugin-unicorn":"48.0.1","@babel/preset-typescript":"7.23.2","@remix-run/server-runtime":"2.1.0","@typescript-eslint/parser":"6.8.0","@typescript-eslint/eslint-plugin":"6.8.0"},"peerDependencies":{"remix-auth":"3.x","@remix-run/server-runtime":"1.x || 2.x"},"_npmOperationalInternal":{"tmp":"tmp/remix-auth-asgardeo_0.0.0_1734630904849_0.9174559471870076","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@asgardeo/remix-auth-asgardeo","version":"0.0.1","keywords":["remix","remix-auth","auth","authentication","strategy","asgardeo"],"author":{"name":"WSO2"},"license":"Apache-2.0","_id":"@asgardeo/remix-auth-asgardeo@0.0.1","maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"homepage":"https://github.com/asgardeo/remix-auth-asgardeo#readme","bugs":{"url":"https://github.com/asgardeo/remix-auth-asgardeo/issues"},"nx":{"includedScripts":["build","lint","test","typecheck"]},"dist":{"shasum":"9c1a68df2c2965cb40dcabd670b4bb3541e519b5","tarball":"https://registry.npmjs.org/@asgardeo/remix-auth-asgardeo/-/remix-auth-asgardeo-0.0.1.tgz","fileCount":4,"integrity":"sha512-Coun17yGncXLUHWhPGwCtQ2rPlp7ryBMokf7DKnUrvR8KQu+FeiyaOMBbUXlWx1PPVY83o4jdmoWNiC4Rg9cxQ==","signatures":[{"sig":"MEUCIGGcvPqKXlA2RyFIPlahhSsq6NlhrtasZ8MUM29zQr47AiEAsxDVMlUEBYRIReRKWy8+5npNA0rl9gGF2txGLbysSTQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20301},"main":"./dist/index.js","_from":"file:asgardeo-remix-auth-asgardeo-0.0.1.tgz","types":"./dist/index.d.ts","scripts":{"lint":"eslint .","test":"jest --config=config/jest.config.ts --passWithNoTests","build":"tsc --project tsconfig.lib.json","test:ci":"pnpm jest --passWithNoTests --coverage","lint:fix":"eslint . --fix","typecheck":"tsc --project tsconfig.json --noEmit"},"_npmUser":{"name":"wso2-org","email":"techops@wso2.com"},"_resolved":"/tmp/217e9ba3950078a30291fcf83fef2c32/asgardeo-remix-auth-asgardeo-0.0.1.tgz","_integrity":"sha512-Coun17yGncXLUHWhPGwCtQ2rPlp7ryBMokf7DKnUrvR8KQu+FeiyaOMBbUXlWx1PPVY83o4jdmoWNiC4Rg9cxQ==","repository":{"url":"git+https://github.com/asgardeo/remix-auth-asgardeo.git","type":"git","directory":"lib"},"_npmVersion":"10.9.0","description":"An Asgardeo Strategy for Remix Auth, based on the OAuth2Strategy","directories":{},"_nodeVersion":"22.12.0","dependencies":{"remix-auth-oauth2":"1.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"29.7.0","react":"^18.2.0","eslint":"~8.57.0","ts-node":"10.9.1","prettier":"^3.4.2","babel-jest":"29.7.0","typescript":"5.2.2","@babel/core":"7.23.2","@jest/types":"^29.6.3","@types/jest":"29.5.5","@types/node":"^22.10.1","@jest/globals":"^29.7.0","@remix-run/node":"2.1.0","jest-fetch-mock":"3.0.3","@remix-run/react":"2.1.0","@babel/preset-env":"7.23.2","@babel/preset-react":"7.22.15","@wso2/eslint-plugin":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?fa0b844715320a3953d6d055997c0770f8695082","@wso2/prettier-config":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?fa0b844715320a3953d6d055997c0770f8695082","eslint-plugin-unicorn":"48.0.1","@babel/preset-typescript":"7.23.2","@remix-run/server-runtime":"2.1.0","@typescript-eslint/parser":"6.8.0","@typescript-eslint/eslint-plugin":"6.8.0"},"peerDependencies":{"remix-auth":"3.x","@remix-run/server-runtime":"1.x || 2.x"},"_npmOperationalInternal":{"tmp":"tmp/remix-auth-asgardeo_0.0.1_1734693265022_0.5462341290912973","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@asgardeo/remix-auth-asgardeo","version":"0.0.2","description":"An Asgardeo Strategy for Remix Auth, based on the OAuth2Strategy","author":{"name":"WSO2"},"license":"Apache-2.0","homepage":"https://github.com/asgardeo/remix-auth-asgardeo#readme","bugs":{"url":"https://github.com/asgardeo/remix-auth-asgardeo/issues"},"repository":{"type":"git","url":"git+https://github.com/asgardeo/remix-auth-asgardeo.git","directory":"lib"},"keywords":["remix","remix-auth","auth","authentication","strategy","asgardeo"],"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","dependencies":{"remix-auth-oauth2":"1.10.0"},"devDependencies":{"@babel/core":"7.23.2","@babel/preset-env":"7.23.2","@babel/preset-react":"7.22.15","@babel/preset-typescript":"7.23.2","@jest/globals":"^29.7.0","@jest/types":"^29.6.3","@remix-run/node":"2.1.0","@remix-run/react":"2.1.0","@remix-run/server-runtime":"2.1.0","@types/jest":"29.5.5","@types/node":"^22.10.1","@typescript-eslint/eslint-plugin":"6.8.0","@typescript-eslint/parser":"6.8.0","@wso2/eslint-plugin":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?fa0b844715320a3953d6d055997c0770f8695082","@wso2/prettier-config":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?fa0b844715320a3953d6d055997c0770f8695082","babel-jest":"29.7.0","eslint":"~8.57.0","eslint-plugin-unicorn":"48.0.1","jest":"29.7.0","jest-fetch-mock":"3.0.3","prettier":"^3.4.2","react":"^18.2.0","ts-node":"10.9.1","typescript":"5.2.2"},"peerDependencies":{"@remix-run/server-runtime":"1.x || 2.x","remix-auth":"3.x"},"publishConfig":{"access":"public"},"nx":{"includedScripts":["build","lint","test","typecheck"]},"scripts":{"build":"tsc --project tsconfig.lib.json","lint":"eslint .","lint:fix":"eslint . --fix","test":"jest --config=config/jest.config.ts --passWithNoTests","test:ci":"pnpm jest --passWithNoTests --coverage","typecheck":"tsc --project tsconfig.json --noEmit"},"_id":"@asgardeo/remix-auth-asgardeo@0.0.2","_integrity":"sha512-Ix6GhKvG0DWjJLGhnAaL7fKM3tXiYlYQnOqyC7gY2RhWYRKg8tuW5PvAlWguKEWePC46k7HRJMcgMK7PAHyiwg==","_resolved":"/tmp/3e092bffbe64b167d8eccd7d4caab536/asgardeo-remix-auth-asgardeo-0.0.2.tgz","_from":"file:asgardeo-remix-auth-asgardeo-0.0.2.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-Ix6GhKvG0DWjJLGhnAaL7fKM3tXiYlYQnOqyC7gY2RhWYRKg8tuW5PvAlWguKEWePC46k7HRJMcgMK7PAHyiwg==","shasum":"7d4834cb80b641b4b6fdabab66dc4866779376b2","tarball":"https://registry.npmjs.org/@asgardeo/remix-auth-asgardeo/-/remix-auth-asgardeo-0.0.2.tgz","fileCount":5,"unpackedSize":26074,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEniTONiWOq2/xMDY7A6aNubWS71RaS8uPGeaKiQH5kIAiEAjo7wcO8mbPgp79qNrpk29YacNXoYkztdHJ7qBmkJkZc="}]},"_npmUser":{"name":"wso2-org","email":"techops@wso2.com"},"directories":{},"maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remix-auth-asgardeo_0.0.2_1735808582711_0.7932805282338657"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-19T17:55:04.782Z","modified":"2025-01-02T09:03:03.122Z","0.0.0":"2024-12-19T17:55:05.003Z","0.0.1":"2024-12-20T11:14:25.197Z","0.0.2":"2025-01-02T09:03:02.928Z"},"bugs":{"url":"https://github.com/asgardeo/remix-auth-asgardeo/issues"},"author":{"name":"WSO2"},"license":"Apache-2.0","homepage":"https://github.com/asgardeo/remix-auth-asgardeo#readme","keywords":["remix","remix-auth","auth","authentication","strategy","asgardeo"],"repository":{"type":"git","url":"git+https://github.com/asgardeo/remix-auth-asgardeo.git","directory":"lib"},"description":"An Asgardeo Strategy for Remix Auth, based on the OAuth2Strategy","maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"readme":"<h1 align=\"center\" style=\"color: #343a40;margin: 20px 0;\">\n  <p align=\"center\">Remix Auth Asgardeo</p>\n</h1>\n\n<div align=\"center\">\n  <a href=\"https://github.com/asgardeo/remix-auth-asgardeo/actions/workflows/release.yml\"><img src=\"https://github.com/asgardeo/remix-auth-asgardeo/actions/workflows/release.yml/badge.svg\" alt=\"🚀 Release\"></a>\n  <a href=\"https://github.com/asgardeo/remix-auth-asgardeo/actions/workflows/builder.yml\"><img src=\"https://github.com/asgardeo/remix-auth-asgardeo/actions/workflows/builder.yml/badge.svg\" alt=\"🧱 Builder\"></a>\n  \n  <a href=\"https://stackoverflow.com/questions/tagged/wso2is\"><img src=\"https://img.shields.io/badge/Ask%20for%20help%20on-Stackoverflow-orange\" alt=\"Stackoverflow\"></a>\n  <a href=\"https://discord.gg/wso2\"><img src=\"https://img.shields.io/badge/Join%20us%20on-Discord-%23e01563.svg\" alt=\"Discord\"></a>\n  <a href=\"https://github.com/asgardeo/remix-auth-asgardeo/blob/main/LICENSE\"><img src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" alt=\"License\"></a>\n  <a href=\"https://twitter.com/intent/follow?screen_name=wso2\"><img src=\"https://img.shields.io/twitter/follow/wso2.svg?style=social&label=Follow\" alt=\"Twitter\"></a>\n</div>\n\n<br>\n\n[Remix Auth](https://remix.run/resources/remix-auth) is a flexible authentication framework for [Remix](https://remix.run/) applications that allows developers to implement various strategies for user authentication.\n\nThe Asgardeo strategy is a custom implementation of the [OAuth2Strategy](https://github.com/sergiodxa/remix-auth-oauth2) designed specifically for integrating with [Asgardeo](https://wso2.com/asgardeo), an identity-as-a-service (IDaaS) platform. This strategy enables developers to authenticate users against an Asgardeo organization using OpenID Connect (OIDC).\n\n## Supported runtimes\n\n| Runtime    | Has Support |\n| ---------- | ----------- |\n| Node.js    | ✅          |\n| Cloudflare | ✅          |\n\n## How to use\n\n### Create an Asgardeo organization\n\nHead over to [Asgardeo](https://wso2.com/asgardeo) and sign up for an organization.\n\n### Register an application\n\nFollow the steps on the [Asgardeo documentation](https://wso2.com/asgardeo/docs/guides/applications/register-oidc-web-app/) to create an application and get the client ID, and client secret.\n\n### Create the Asgardeo strategy instance\n\n```ts\n// app/utils/asgardeo.server.ts\nimport { Authenticator } from \"remix-auth\";\nimport { AsgardeoStrategy } from \"remix-auth-asgardeo\";\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 asgardeoStrategy = new AsgardeoStrategy(\n  {\n    authorizedRedirectUrl: \"http://localhost:5173/auth/asgardeo/callback\",\n    clientID: \"YOUR_ASGARDEO_CLIENT_ID\",\n    clientSecret: \"YOUR_ASGARDEO_CLIENT_SECRET\",\n    baseUrl: \"https://api.asgardeo.io/t/<YOUR_ASGARDEO_ORG_NAME>\",\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.emails[0].value });\n  }\n);\n\nauthenticator.use(asgardeoStrategy);\n```\n\n### Setup application routes\n\n```ts\n// app/routes/login.tsx\nexport default function Login() {\n  return (\n    <Form action=\"/auth/asgardeo\" method=\"post\">\n      <button>Login with Asgardeo</button>\n    </Form>\n  );\n}\n```\n\n```ts\n// app/routes/auth.asgardeo.tsx\nimport type { ActionFunctionArgs } from \"@remix-run/node\";\n\nimport { authenticator } from \"~/utils/asgardeo.server\";\n\nexport let loader = () => redirect(\"/login\");\n\nexport let action = ({ request }: ActionFunctionArgs) => {\n  return authenticator.authenticate(\"asgardeo\", request);\n};\n```\n\n```ts\n// app/routes/auth.asgardeo.callback.tsx\nimport type { LoaderFunctionArgs } from \"@remix-run/node\";\n\nimport { authenticator } from \"~/utils/asgardeo.server\";\n\nexport let loader = ({ request }: LoaderFunctionArgs) => {\n  return authenticator.authenticate(\"asgardeo\", request, {\n    successRedirect: \"/dashboard\",\n    failureRedirect: \"/login\",\n  });\n};\n```\n\n```ts\n// app/routes/auth.logout.ts\nimport type { ActionFunctionArgs } from \"@remix-run/node\";\n\nimport { redirect } from \"@remix-run/node\";\n\nimport { destroySession, getSession } from \"~/utils/asgardeo.server\";\n\nexport const action = async ({ request }: ActionFunctionArgs) => {\n  const session = await getSession(request.headers.get(\"Cookie\"));\n  const logoutURL = new URL(process.env.ASGARDEO_LOGOUT_URL); // i.e https://api.asgardeo.io/t/pavinduorg/oidc/logout\n\n  logoutURL.searchParams.set(\"client_id\", process.env.ASGARDEO_CLIENT_ID);\n  logoutURL.searchParams.set(\"returnTo\", process.env.ASGARDEO_RETURN_TO_URL);\n\n  return redirect(logoutURL.toString(), {\n    headers: {\n      \"Set-Cookie\": await destroySession(session),\n    },\n  });\n};\n```\n\n## Contribute\nPlease read [Contributing Guide](CONTRIBUTING.md) for details on how to contribute to Remix Auth Asgardeo. Refer to [General Contribution Guidelines](http://wso2.github.io/) for details on our code of conduct, and the process for submitting pull requests to us.\n\n### Reporting issues\nWe encourage you to report issues, improvements, and feature requests creating [Github Issues](https://github.com/asgardeo/remix-auth-asgardeo/issues).\n\n**Important**: Please be advised that security issues MUST be reported to <a href=\"mailto:security@wso2.com\">security@wso2com</a>, not as GitHub issues, in order to reach the proper audience. We strongly advise following the WSO2 Security Vulnerability Reporting Guidelines when reporting the security issues.\n\n## License\nThis project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.\n","readmeFilename":"README.md"}