{"id":15509780,"url":"https://github.com/willin/remix-auth-sso","last_synced_at":"2025-07-28T11:05:21.994Z","repository":{"id":207708211,"uuid":"719926383","full_name":"willin/remix-auth-sso","owner":"willin","description":"A Simple SSO Auth Strategy For Willin SSO","archived":false,"fork":false,"pushed_at":"2024-01-05T06:18:36.000Z","size":75,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-21T12:45:16.010Z","etag":null,"topics":["auth","remix","sso"],"latest_commit_sha":null,"homepage":"https://github.com/willin/sso","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"willin","custom":"https://afdian.net/@willin"}},"created_at":"2023-11-17T07:43:30.000Z","updated_at":"2024-01-21T03:34:56.000Z","dependencies_parsed_at":"2024-01-11T21:39:39.645Z","dependency_job_id":"3521faf3-8547-4de3-8257-583acf993b73","html_url":"https://github.com/willin/remix-auth-sso","commit_stats":null,"previous_names":["willin/remix-auth-sso"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/willin/remix-auth-sso","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fremix-auth-sso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fremix-auth-sso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fremix-auth-sso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fremix-auth-sso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willin","download_url":"https://codeload.github.com/willin/remix-auth-sso/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fremix-auth-sso/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267505099,"owners_count":24098346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth","remix","sso"],"created_at":"2024-10-02T09:43:54.634Z","updated_at":"2025-07-28T11:05:21.962Z","avatar_url":"https://github.com/willin.png","language":"TypeScript","funding_links":["https://github.com/sponsors/willin","https://afdian.net/@willin"],"categories":[],"sub_categories":[],"readme":"# SSOStrategy\n\nThe SSO strategy is used to authenticate users against a SSO account. It extends the OAuth2Strategy.\n\n## Supported runtimes\n\n| Runtime    | Has Support |\n| ---------- | ----------- |\n| Node.js    | ✅          |\n| Cloudflare | ✅          |\n\n## Usage\n\n### Create an OAuth application\n\nFollow the steps on [the SSO documentation](https://github.com/willin/sso) to create a new application and get a client ID and secret.\n\n### Create the strategy instance\n\n```ts\nimport { SSOStrategy } from 'remix-auth-sso';\n\nlet ssoStrategy = new SSOStrategy(\n  {\n    clientID: 'YOUR_CLIENT_ID',\n    clientSecret: 'YOUR_CLIENT_SECRET',\n    callbackURL: 'https://example.com/auth/sso/callback'\n  },\n  async ({ accessToken, extraParams, profile }) =\u003e {\n    // Get the user data from your DB or API using the tokens and profile\n    return profile;\n  }\n);\n\nauthenticator.use(ssoStrategy);\n```\n\n### Setup your routes\n\n```tsx\n// app/routes/login.tsx\nexport default function Login() {\n  return (\n    \u003cForm action='/auth/sso' method='post'\u003e\n      \u003cbutton\u003eLogin with SSO\u003c/button\u003e\n    \u003c/Form\u003e\n  );\n}\n```\n\n```tsx\n// app/routes/auth.sso.tsx\nimport type { ActionArgs } from '@remix-run/node';\nimport { redirect } from '@remix-run/node';\nimport { authenticator } from '~/auth.server';\n\nexport async function loader() {\n  return redirect('/login');\n}\n\nexport async function action({ request }: ActionArgs) {\n  return authenticator.authenticate('sso', request);\n}\n```\n\n```tsx\n// app/routes/auth.sso.callback.tsx\nimport type { LoaderArgs } from '@remix-run/node';\nimport { authenticator } from '~/auth.server';\n\nexport async function loader({ request }: LoaderArgs) {\n  return authenticator.authenticate('sso', request, {\n    successRedirect: '/dashboard',\n    failureRedirect: '/login'\n  });\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Fremix-auth-sso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillin%2Fremix-auth-sso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Fremix-auth-sso/lists"}