From 8ae446322a9b402370e732621853115c53eee0a6 Mon Sep 17 00:00:00 2001
From: PrtmPhlp
Date: Sat, 1 Feb 2025 16:26:59 +0100
Subject: [PATCH] docs: Added Gitea and Memos example (#194)
---
docs/docs/client-examples/gitea.md | 30 ++++++++++++++++++++++++++++++
docs/docs/client-examples/memos.md | 28 ++++++++++++++++++++++++++++
docs/sidebars.ts | 2 ++
3 files changed, 60 insertions(+)
create mode 100644 docs/docs/client-examples/gitea.md
create mode 100644 docs/docs/client-examples/memos.md
diff --git a/docs/docs/client-examples/gitea.md b/docs/docs/client-examples/gitea.md
new file mode 100644
index 0000000..a7d259b
--- /dev/null
+++ b/docs/docs/client-examples/gitea.md
@@ -0,0 +1,30 @@
+---
+id: gitea
+---
+
+# Gitea
+
+## Pocket ID Setup
+
+1. In Pocket ID, create a new OIDC client named `Gitea` (or any name you prefer).
+2. (Optional) Set a logo for the OIDC client.
+3. Set the callback URL to: `https:///user/oauth2/PocketID/callback`
+4. Copy the `Client ID`, `Client Secret`, and `OIDC Discovery URL` for the next steps.
+
+## Gitea Setup
+
+1. Log in to Gitea as an admin.
+2. Go to **Site Administration → Identity & Access → Authentication Sources**.
+3. Click **Add Authentication Source**.
+4. Set **Authentication Type** to `OAuth2`.
+5. Set **Authentication Name** to `PocketID`.
+ :::important
+ If you change this name, update the callback URL in Pocket ID to match.
+ :::
+6. Set **OAuth2 Provider** to `OpenID Connect`.
+7. Enter the `Client ID` into the **Client ID (Key)** field.
+8. Enter the `Client Secret` into the **Client Secret** field.
+9. Enter the `OIDC Discovery URL` into the **OpenID Connect Auto Discovery URL** field.
+10. Enable **Skip local 2FA**.
+11. Set **Additional Scopes** to `openid email profile`.
+12. Save the settings and test the OAuth login.
\ No newline at end of file
diff --git a/docs/docs/client-examples/memos.md b/docs/docs/client-examples/memos.md
new file mode 100644
index 0000000..4cbf9eb
--- /dev/null
+++ b/docs/docs/client-examples/memos.md
@@ -0,0 +1,28 @@
+---
+id: memos
+---
+
+# Memos
+
+## Pocket ID Setup
+
+1. In Pocket ID, create a new OIDC client named `Memos` (or any name you prefer).
+2. (Optional) Set a logo for the OIDC client.
+3. Set the callback URL to: `https://< Memos Host >/auth/callback`
+4. Copy the `Client ID`, `Client Secret`, `Authorization endpoint`, `Token endpoint`, and `User endpoint` for the next steps.
+
+## Gitea Setup
+
+1. Log in to Memos as an admin.
+2. Go to **Settings → SSO → Create**.
+3. Set **Template** to `Custom`.
+4. Enter the `Client ID` into the **Client ID** field.
+5. Enter the `Client Secret` into the **Client secret** field.
+6. Enter the `Authorization URL` into the **Authorization endpoint** field.
+7. Enter the `Token URL` into the **Token endpoint** field.
+8. Enter the `Userinfo URL` into the **User endpoint** field.
+11. Set **Scopes** to `openid email profile`.
+12. Set **Identifier** to `preferred_username`
+13. Set **Display Name** to `profile`.
+14. Set **Email** to `email`.
+15. Save the settings and test the OAuth login.
\ No newline at end of file
diff --git a/docs/sidebars.ts b/docs/sidebars.ts
index 7ffe755..c5af1e5 100644
--- a/docs/sidebars.ts
+++ b/docs/sidebars.ts
@@ -72,6 +72,8 @@ const sidebars: SidebarsConfig = {
"client-examples/proxmox",
"client-examples/semaphore-ui",
"client-examples/vikunja",
+ "client-examples/gitea",
+ "client-examples/memos",
],
},
{