Skip to content

Fully autonomous AI Agents system capable of performing complex penetration testing tasks

docs: fix OAuth callback URL docs

Mason Kim(ZINUS US_SALES)ef195de84a52
diff --git a/README.md b/README.md
index 390cead8..1ff9872d 100644
--- a/README.md
+++ b/README.md
@@ -2331,17 +2331,17 @@ OAuth integration with GitHub and Google allows users to authenticate using thei
- Access to user profile information from GitHub/Google accounts
- Seamless integration with existing development workflows
-PentAGI uses `PUBLIC_URL` as the public base URL for OAuth redirects. In the default deployment, both GitHub and Google callbacks are handled by:
+PentAGI uses `PUBLIC_URL` as the public origin/base URL for OAuth redirects. In the default deployment, both GitHub and Google callbacks are handled by:
```text
-${PUBLIC_URL}/auth/login-callback
+${PUBLIC_URL}/api/v1/auth/login-callback
```
For GitHub OAuth:
1. Create a new OAuth App in your GitHub account.
2. Set **Homepage URL** to your `PUBLIC_URL`.
-3. Set **Authorization callback URL** to `${PUBLIC_URL}/auth/login-callback`.
+3. Set **Authorization callback URL** to `${PUBLIC_URL}/api/v1/auth/login-callback`.
4. Add the client credentials to your `.env` file:
```bash
@@ -2353,7 +2353,7 @@ OAUTH_GITHUB_CLIENT_SECRET=your_github_client_secret
For Google OAuth:
1. Create OAuth credentials in your Google Cloud project.
-2. Use the same callback endpoint: `${PUBLIC_URL}/auth/login-callback`.
+2. Use the same callback endpoint: `${PUBLIC_URL}/api/v1/auth/login-callback`.
3. Add the client credentials to your `.env` file:
```bash
@@ -2362,7 +2362,7 @@ OAUTH_GOOGLE_CLIENT_ID=your_google_client_id
OAUTH_GOOGLE_CLIENT_SECRET=your_google_client_secret
```
-Make sure `PUBLIC_URL` matches the externally accessible HTTPS address of your PentAGI instance. If the URL configured in the OAuth provider does not exactly match the callback generated by PentAGI, the provider will reject the login attempt with a redirect URI mismatch error.
+Make sure `PUBLIC_URL` matches the externally accessible HTTPS address of your PentAGI instance and does not include the callback path itself. If the URL configured in the OAuth provider does not exactly match the callback generated by PentAGI, the provider will reject the login attempt with a redirect URI mismatch error.
### Docker Image Configuration
diff --git a/backend/docs/config.md b/backend/docs/config.md
index c2a65e91..1bbc1455 100644
--- a/backend/docs/config.md
+++ b/backend/docs/config.md
@@ -382,7 +382,7 @@ These settings control authentication mechanisms, including cookie-based session
| Option | Environment Variable | Default Value | Description |
| ----------------------- | ---------------------------- | ------------- | ------------------------------------------------------ |
| CookieSigningSalt | `COOKIE_SIGNING_SALT` | *(none)* | Salt for signing and securing cookies used in sessions |
-| PublicURL | `PUBLIC_URL` | *(none)* | Public base URL used to build OAuth callback URLs such as `/auth/login-callback` |
+| PublicURL | `PUBLIC_URL` | *(none)* | Public origin/base URL used to build OAuth callback URLs such as `/api/v1/auth/login-callback` |
| OAuthGoogleClientID | `OAUTH_GOOGLE_CLIENT_ID` | *(none)* | Google OAuth client ID for authentication |
| OAuthGoogleClientSecret | `OAUTH_GOOGLE_CLIENT_SECRET` | *(none)* | Google OAuth client secret |
| OAuthGithubClientID | `OAUTH_GITHUB_CLIENT_ID` | *(none)* | GitHub OAuth client ID for authentication |
@@ -402,12 +402,12 @@ The authentication settings are used in `pkg/server/router.go` to set up authent
router.Use(sessions.Sessions("auth", cookieStore))
```
-- **PublicURL**: The base URL for OAuth callback endpoints, crucial for redirects after authentication:
+- **PublicURL**: The public origin/base URL for OAuth callback endpoints, crucial for redirects after authentication:
```go
publicURL, err := url.Parse(cfg.PublicURL)
```
- The router builds the login callback path by appending `/auth/login-callback` to this public URL:
+ The router builds the login callback path under the API base URL:
```go
oauthLoginCallbackURL := "/auth/login-callback"
@@ -419,7 +419,7 @@ The authentication settings are used in `pkg/server/router.go` to set up authent
In the default deployment, configure your OAuth providers with:
- **Homepage URL**: `PUBLIC_URL`
- - **Authorization callback URL / Redirect URI**: `${PUBLIC_URL}/auth/login-callback`
+ - **Authorization callback URL / Redirect URI**: `${PUBLIC_URL}/api/v1/auth/login-callback`
Example:
```bash
@@ -453,7 +453,7 @@ The authentication settings are used in `pkg/server/router.go` to set up authent
}
```
- Google and GitHub both use the same PentAGI login callback endpoint. If the URL configured in the provider console does not exactly match the generated callback URL, authentication will fail with a redirect URI mismatch error.
+ Google and GitHub both use the same PentAGI login callback endpoint. `PUBLIC_URL` should be the externally reachable base URL only, without an extra path suffix. If the URL configured in the provider console does not exactly match the generated callback URL, authentication will fail with a redirect URI mismatch error.
These settings are essential for:
- Secure user authentication and session management