https://github.com/epicweb-dev/epic-oidc
https://github.com/epicweb-dev/epic-oidc
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/epicweb-dev/epic-oidc
- Owner: epicweb-dev
- Created: 2023-08-16T00:19:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T18:25:24.000Z (over 1 year ago)
- Last Synced: 2025-05-06T15:19:13.056Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 10.6 MB
- Stars: 30
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Epic OIDC Example
[Here's the commit that adds Google Auth](https://github.com/kentcdodds/epic-oidc/commit/517b7b97e37f39bc4b86b249519255e92bb37e72).
This is an updated and simplified version, but the demo for the original version
is still instructive:[](https://www.epicweb.dev/tips/add-open-id-connect-auth-to-the-epic-stack)
This is an
[Epic Stack example](https://github.com/epicweb-dev/epic-stack/blob/main/docs/examples.md)
which demonstrates how to implement authentication using an OpenID Connect
provider.In this example, we have three forms of authentication:
1. Username/password (built-into the Epic Stack)
2. GitHub OAuth2 (built-into the Epic Stack)
3. Google OpenID Connect (implemented in this example)There are no database schema changes necessary for adding an OIDC provider (like
Google).This example uses [web-oidc](https://npm.im/web-oidc) and
[remix-auth](https://npm.im/remix-auth) to implement the OIDC authentication
flow. This example doesn't deal with refresh tokens because we're only using the
OIDC provider for authentication. If you need to use refresh tokens, then you'll
need to store them in a database and use them to get new access tokens when
necessary.## Mocks
Check out
[this "setup mocks" commit](https://github.com/kentcdodds/epic-oidc/commit/1a8cead2d28c79ca1509d4d2f06004c1769f998b)
for how to set up mocks for your tests and local development.