{"id":22444642,"url":"https://github.com/smartive/next-with-lucia-example","last_synced_at":"2025-03-27T10:43:08.583Z","repository":{"id":265763912,"uuid":"878541296","full_name":"smartive/next-with-lucia-example","owner":"smartive","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-25T15:37:00.000Z","size":79,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-19T07:21:57.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-25T15:25:02.000Z","updated_at":"2024-10-25T15:36:40.000Z","dependencies_parsed_at":"2024-11-30T21:04:43.102Z","dependency_job_id":"5accb6fd-7c1c-4e74-af6e-7ffb97b981a1","html_url":"https://github.com/smartive/next-with-lucia-example","commit_stats":null,"previous_names":["smartive/next-with-lucia-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartive%2Fnext-with-lucia-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartive%2Fnext-with-lucia-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartive%2Fnext-with-lucia-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartive%2Fnext-with-lucia-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartive","download_url":"https://codeload.github.com/smartive/next-with-lucia-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245832608,"owners_count":20679701,"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","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":[],"created_at":"2024-12-06T03:09:22.170Z","updated_at":"2025-03-27T10:43:08.558Z","avatar_url":"https://github.com/smartive.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next.js OIDC Authentication Example\nThis repository provides an example implementation of OIDC authentication for Next.js App Router applications, focusing on server-side session management, token refreshing, and seamless client-server state synchronization.\n\nThis example is discussed in detail in the blog post: [Implementing OIDC Authentication in Next.js App Router](https://smartive.ch/blog/a-better-way-to-authenticate-oidc-in-next-js-with-lucia-auth) — Please refer to the post for an in-depth explanation of the concepts, challenges, and code examples.\n\n\n## Setup\n\n### 1. Google Cloud Console Configuration\nTo use this example, set up an OIDC client with Google:\n\n1. Go to the Google Cloud Console.\n2. Create a new project (or select an existing one).\n3. Navigate to APIs \u0026 Services \u003e OAuth consent screen and configure your consent screen.\n4. Go to Credentials \u003e Create Credentials \u003e OAuth 2.0 Client IDs.\n5. Choose Web application as the application type.\n6. Under Authorized redirect URIs, add: http://localhost:3000/api/auth/callback\n7. Save the credentials and note down the Client ID and Client Secret.\n\n### 2. Environment Variables\nCreate a .env.local file in the root of the repository and add the following variables:\n\n```env\nOIDC_LOGIN_URL=https://accounts.google.com\nOIDC_CLIENT_ID=your-google-client-id\nOIDC_CLIENT_SECRET=your-google-client-secret\nNEXT_PUBLIC_FULL_APP_URL=http://localhost:3000\n```\nReplace your-google-client-id and your-google-client-secret with the credentials obtained from the Google Cloud Console.\n\n### 3. Start Application\n\nrun the development server:\n\n```bash\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartive%2Fnext-with-lucia-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartive%2Fnext-with-lucia-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartive%2Fnext-with-lucia-example/lists"}