-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c06c51
commit 77b589d
Showing
10 changed files
with
226 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: Authentication | ||
--- | ||
|
||
# Authentication | ||
|
||
Ctrlplane supports multiple authentication methods to secure your application. | ||
|
||
## Available Authentication Methods | ||
|
||
import { Cards } from "nextra/components"; | ||
import { RiLockPasswordLine } from "react-icons/ri"; | ||
import { SiAuth0, SiGoogle } from "react-icons/si"; | ||
|
||
<Cards> | ||
<Cards.Card | ||
icon={<SiGoogle className="h-8 w-8" />} | ||
title="Google" | ||
href="/auth/google" | ||
/> | ||
<Cards.Card | ||
icon={<SiAuth0 className="h-8 w-8" />} | ||
title="OIDC" | ||
href="/auth/oidc" | ||
/> | ||
<Cards.Card | ||
icon={<RiLockPasswordLine className="h-8 w-8" />} | ||
title="Basic Auth" | ||
href="/auth/basic" | ||
/> | ||
</Cards> | ||
|
||
Please see the individual sections for detailed information on how to set up | ||
each authentication method, including the required environment variables and | ||
configuration steps. | ||
|
||
## General Configuration | ||
|
||
Regardless of the authentication method you choose, you'll need to set the | ||
following environment variable: | ||
|
||
- `AUTH_SECRET`: A secret key used to encrypt tokens and sign cookies. | ||
|
||
This can be generated by running: | ||
|
||
```bash | ||
$ openssl rand -base64 32 | ||
``` | ||
|
||
## Authentication Priority | ||
|
||
It's important to note that if Google or OIDC authentication is configured, | ||
basic (credentials) authentication will be disabled by default. If you want to | ||
enable basic authentication alongside other methods, you need to explicitly set | ||
`AUTH_CREDENTIALS_ENABLED` to `true`. | ||
|
||
## Next Steps | ||
|
||
Choose the authentication method that best suits your needs and follow the setup | ||
instructions in the respective section. Each authentication method has its own | ||
requirements and configuration steps, so be sure to review the documentation | ||
carefully. | ||
|
||
If you need help or have any questions about setting up authentication for your | ||
Ctrlplane application, please don't hesitate to reach out to our support team in | ||
Discord. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
google: "Google", | ||
oidc: "OIDC", | ||
basic: "Basic", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: Basic Authentication | ||
--- | ||
|
||
# Basic Authentication | ||
|
||
This guide will help you set up basic (email/password) authentication for your | ||
Ctrlplane application. | ||
|
||
import { Callout } from "nextra/components"; | ||
|
||
<Callout type="warning"> | ||
Basic authentication is not recommended for production environments. It is | ||
primarily intended for testing and development purposes. For production | ||
deployments, consider using more secure authentication methods like Google or | ||
OIDC. | ||
</Callout> | ||
|
||
## Configuration | ||
|
||
To enable basic authentication, you need to set the following environment | ||
variables: | ||
|
||
- `AUTH_SECRET`: A secret key used to encrypt tokens and sign cookies. | ||
|
||
This can be generated by running: | ||
|
||
```bash | ||
$ openssl rand -base64 32 | ||
``` | ||
|
||
If Google or OIDC authentication is not configured, basic authentication will be | ||
enabled by default. However, if you want to use basic authentication alongside | ||
other methods, you must explicitly set `AUTH_CREDENTIALS_ENABLED` to `true`. | ||
|
||
## Usage | ||
|
||
With basic authentication enabled, a new "Sign up" button will be displayed in | ||
the `/login` page where users can sign up using their email and password. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: Google Authentication | ||
--- | ||
|
||
# Google Authentication | ||
|
||
This guide will help you set up Google authentication for your Ctrlplane | ||
application. | ||
|
||
## Prerequisites | ||
|
||
1. A Google Cloud Platform (GCP) account | ||
2. A GCP project with the Google+ API enabled | ||
|
||
## Setup Steps | ||
|
||
1. Go to the [Google Cloud Console](https://console.cloud.google.com/). | ||
2. Select your project or create a new one. | ||
3. Navigate to "APIs & Services" > "Credentials". | ||
4. Click "Create Credentials" and select "OAuth client ID". | ||
5. Choose "Web application" as the application type. | ||
6. Set the authorized redirect URI to | ||
`https://your-domain.com/api/auth/callback/google`. | ||
7. Click "Create" to generate your client ID and client secret. | ||
|
||
## Configuration | ||
|
||
To enable Google authentication, you need to set the following environment | ||
variables: | ||
|
||
- `AUTH_GOOGLE_CLIENT_ID`: Your Google OAuth client ID | ||
- `AUTH_GOOGLE_CLIENT_SECRET`: Your Google OAuth client secret | ||
|
||
When these variables are set, Google authentication will be automatically | ||
enabled, and basic authentication will be disabled unless explicitly enabled. | ||
|
||
## Usage | ||
|
||
Once configured, users will be able to sign in to your Ctrlplane application | ||
using their Google accounts. The authentication flow will redirect users to | ||
Google's login page and then back to your application after successful | ||
authentication. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: OIDC Authentication | ||
--- | ||
|
||
# OIDC Authentication | ||
|
||
This guide will help you set up OIDC (OpenID Connect) authentication for your | ||
Ctrlplane application. This method can be used with various identity providers. | ||
|
||
## Prerequisites | ||
|
||
1. An account with an OIDC-compliant identity provider (e.g. Auth0, Okta, Azure | ||
AD) | ||
2. An application or client registered with your identity provider | ||
|
||
## Setup Steps | ||
|
||
1. Log in to your identity provider's dashboard. | ||
2. Create a new application or client (if you haven't already). | ||
3. Configure the application settings: | ||
- Set the allowed callback URLs to | ||
`https://your-domain.com/api/auth/callback/oidc`. | ||
- Note down the client ID, client secret, and issuer URL. | ||
|
||
## Configuration | ||
|
||
To enable OIDC authentication, you need to set the following environment | ||
variables: | ||
|
||
- `AUTH_OIDC_CLIENT_ID`: Your OIDC client ID | ||
- `AUTH_OIDC_CLIENT_SECRET`: Your OIDC client secret | ||
- `AUTH_OIDC_ISSUER`: The issuer URL for your OIDC provider | ||
|
||
When these variables are set, OIDC authentication will be automatically enabled, | ||
and basic authentication will be disabled unless explicitly enabled. | ||
|
||
## Usage | ||
|
||
Once configured, users will be able to sign in to your Ctrlplane application | ||
using the configured OIDC provider. The authentication flow will redirect users | ||
to the provider's login page and then back to your application after successful | ||
authentication. | ||
|
||
This method allows for seamless integration with various identity providers, | ||
giving you flexibility in choosing the authentication system that best fits your | ||
organization's needs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters