Something went wrong. Try again.
Dedicated SSR (Server-side-rendered) Astro native Headless CMS, build from the ground up for the Astro community and by Astro community memb github.com/withstudiocms/studiocms
Something went wrong. Try again.
2 folders · 9 files
README.md
@studiocms/oauth #
This package provides multiple OAuth providers for StudioCMS, enabling authentication via various OAuth services.
Providers #
- Auth0
- Discord
- GitHub
Usage #
Adding a Provider #
To add a provider, import the desired provider from @studiocms/oauth and include it in your StudioCMS config. (studiocms.config.mjs)
import { defineStudioCMSConfig } from 'studiocms/config';
import { auth0, discord, github, google } from '@studiocms/oauth';
export default defineStudioCMSConfig({
// other options here
plugins: [
auth0(),
discord(),
github(),
google()
]
});
Note you can also import and use individual providers from their respective exports, such as @studiocms/oauth/auth0, @studiocms/oauth/discord, @studiocms/oauth/github, and @studiocms/oauth/google.
Required ENV Variables #
Auth0 #
CMS_AUTH0_CLIENT_IDCMS_AUTH0_CLIENT_SECRETCMS_AUTH0_DOMAINCMS_AUTH0_REDIRECT_URI
Discord #
CMS_DISCORD_CLIENT_IDCMS_DISCORD_CLIENT_SECRETCMS_DISCORD_REDIRECT_URI
GitHub #
CMS_GITHUB_CLIENT_IDCMS_GITHUB_CLIENT_SECRETCMS_GITHUB_REDIRECT_URI
Google #
CMS_GOOGLE_CLIENT_IDCMS_GOOGLE_CLIENT_SECRETCMS_GOOGLE_REDIRECT_URI