{"id":51405277,"url":"https://github.com/alyldas/uniauth-oauth-oidc-provider","last_synced_at":"2026-07-04T10:31:41.674Z","repository":{"id":360713102,"uuid":"1250378506","full_name":"alyldas/uniauth-oauth-oidc-provider","owner":"alyldas","description":"OAuth/OIDC provider adapter helpers for UniAuth.","archived":false,"fork":false,"pushed_at":"2026-05-27T16:13:04.000Z","size":45,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T16:15:41.739Z","etag":null,"topics":["auth","authentication","oauth","oidc","provider","typescript","uniauth"],"latest_commit_sha":null,"homepage":"https://github.com/alyldas/uniauth-oauth-oidc-provider#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alyldas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-26T15:13:33.000Z","updated_at":"2026-05-27T16:13:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alyldas/uniauth-oauth-oidc-provider","commit_stats":null,"previous_names":["alyldas/uniauth-oauth-oidc-provider"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/alyldas/uniauth-oauth-oidc-provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-oauth-oidc-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-oauth-oidc-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-oauth-oidc-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-oauth-oidc-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alyldas","download_url":"https://codeload.github.com/alyldas/uniauth-oauth-oidc-provider/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-oauth-oidc-provider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35118970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"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","authentication","oauth","oidc","provider","typescript","uniauth"],"created_at":"2026-07-04T10:31:40.931Z","updated_at":"2026-07-04T10:31:41.653Z","avatar_url":"https://github.com/alyldas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UniAuth OAuth OIDC Provider\n\n[![GitHub Packages](https://img.shields.io/static/v1?label=GitHub%20Packages\u0026message=%40alyldas%2Funiauth-oauth-oidc-provider\u0026color=24292f\u0026logo=github)](https://github.com/users/alyldas/packages/npm/package/uniauth-oauth-oidc-provider)\n\n`@alyldas/uniauth-oauth-oidc-provider` exposes a small SDK-free contract for OAuth and OIDC\nprovider adapters. It maps a validated provider profile into a UniAuth `ProviderIdentityAssertion`\nand delegates account decisions to the existing UniAuth core flow.\n\n## Runtime Boundary\n\nThis package does not own authorization URL creation, callback routes, state and nonce validation,\nredirect URI policy, PKCE storage, provider secrets, HTTP clients, token persistence, refresh, or\nrevocation.\n\n## Install\n\nConfigure the GitHub Packages registry for the package scope before installing:\n\n```ini\n@alyldas:registry=https://npm.pkg.github.com\n```\n\nGitHub Packages can require authentication for package reads. Use a token with `read:packages` in local npm config or CI secrets; do not commit tokens.\n\n```bash\nnpm install @alyldas/uniauth-core @alyldas/uniauth-oauth-oidc-provider\n```\n\n## Usage\n\n```ts\nimport { createOAuthOidcProvider, type OAuthOidcClient } from '@alyldas/uniauth-oauth-oidc-provider'\n\nconst client: OAuthOidcClient = {\n  async exchangeCode(input) {\n    return appOAuthClient.exchangeCode({\n      code: input.code,\n      redirectUri: input.redirectUri,\n      codeVerifier: input.codeVerifier,\n    })\n  },\n  async fetchProfile(input) {\n    return appOAuthClient.fetchUserInfo(input.tokens)\n  },\n}\n\nproviderRegistry.register(\n  createOAuthOidcProvider({\n    providerId: 'example-oauth',\n    client,\n  }),\n)\n```\n\n```ts\nawait auth.public.provider.signIn({\n  provider: 'example-oauth',\n  finishInput: {\n    code: request.query.code,\n    state: request.query.state,\n    payload: {\n      redirectUri: 'https://app.example/auth/callback',\n      codeVerifier: request.session.oauthCodeVerifier,\n    },\n  },\n})\n```\n\nThe built-in mapper uses `profile.subject` as `providerUserId`, maps verified email and phone\nclaims, and copies only reduced profile metadata such as issuer, preferred username, picture URL,\nlocale, and explicit app-provided profile metadata.\n\nUse `mapProfile` when a provider needs a custom subject format or tenant-specific metadata:\n\n```ts\ncreateOAuthOidcProvider({\n  providerId: 'tenant-oauth',\n  client,\n  mapProfile: ({ provider, profile }) =\u003e ({\n    provider,\n    providerUserId: `${profile.issuer}:${profile.subject}`,\n  }),\n})\n```\n\nUse `createOAuthOidcTokenRecord(...)` when an application needs one normalized shape for\napplication-owned token persistence. See [provider token persistence](docs/provider-token-persistence.md).\n\n## Security Notes\n\n- Validate `state`, `nonce`, redirect URI, and PKCE verifier in application code.\n- Keep provider secrets in the application-owned client.\n- Do not store access tokens, ID tokens, or refresh tokens in `ProviderIdentityAssertion.metadata`.\n- Token storage, refresh token rotation, and provider revocation remain application-owned.\n- UniAuth policy invariants still apply after mapping.\n\n## Local Checks\n\n```bash\nnpm run check\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falyldas%2Funiauth-oauth-oidc-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falyldas%2Funiauth-oauth-oidc-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falyldas%2Funiauth-oauth-oidc-provider/lists"}