Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4d101fb
feat: add LogoInput component to settings input for app logo configur…
danielalves96 Jul 7, 2025
7f76d48
feat: implement two-factor authentication (2FA) functionality
danielalves96 Jul 8, 2025
e4bdfb8
fix: update translations and clean up imports in various components
danielalves96 Jul 8, 2025
61255b5
fix: update translation key for backup codes instructions in two-fact…
danielalves96 Jul 8, 2025
b26450d
Feat: Add 2FA/TOPT Support (#130)
danielalves96 Jul 8, 2025
1134beb
fix: update French translations for file sharing feature
danielalves96 Jul 8, 2025
233ea0d
fix: update ESLint configuration to include .next directory in ignores
danielalves96 Jul 8, 2025
199dd9f
chore: add .eslintignore file and update TypeScript configuration
danielalves96 Jul 8, 2025
a3389b8
feat: implement chunked file upload and progress tracking
danielalves96 Jul 8, 2025
e9ae414
feat: add Pocket ID as a new OIDC provider
danielalves96 Jul 8, 2025
ffd5005
feat: Add Pocket ID as a new OIDC provider (#133)
danielalves96 Jul 8, 2025
ad689bd
feat(auth): add trusted device support for 2FA
danielalves96 Jul 9, 2025
f3f792e
feat(auth): enhance trusted device management for 2FA
danielalves96 Jul 10, 2025
dc3da45
fix: update dependencies in hooks for improved functionality
danielalves96 Jul 10, 2025
edf20e6
Feat: Add trusted device support for 2FA (#138)
danielalves96 Jul 10, 2025
5672d25
Merge branch 'feat/chunked-uploads' into next
danielalves96 Jul 10, 2025
2e56b7e
feat(auth): enhance client header handling in proxy requests
danielalves96 Jul 11, 2025
a4bc5ec
feat(auth): improve user data fetching on authentication
danielalves96 Jul 11, 2025
f1ef32b
refactor(auth): remove unused import in useLogin hook
danielalves96 Jul 11, 2025
a5a22ca
feat(profile): implement image editing functionality with cropping an…
danielalves96 Jul 11, 2025
90c0300
chore: update package versions to v3.1.1-beta for docs, server, and w…
danielalves96 Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions apps/docs/content/docs/3.1-beta/oidc-authentication/meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"defaultOpen": false,
"icon": "Key",
"pages": ["index", "google", "discord", "github", "zitadel", "auth0", "authentik", "frontegg", "kinde-auth", "other"],
"pages": [
"index",
"google",
"discord",
"github",
"zitadel",
"auth0",
"authentik",
"frontegg",
"kinde-auth",
"pocket-id",
"other"
],
"title": "OIDC Authentication"
}
}
279 changes: 279 additions & 0 deletions apps/docs/content/docs/3.1-beta/oidc-authentication/pocket-id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
---
title: Pocket ID
icon: IdCardLanyard
---

import { ZoomableImage } from "@/components/ui/zoomable-image";

Pocket ID is one of Palmr's officially supported OIDC providers, offering a robust and flexible identity management solution. This integration allows users to sign in to Palmr using Pocket ID's authentication system, making it perfect for organizations that need a self-hosted identity provider with OIDC support.

<ZoomableImage src="/assets/v3/oidc/pocket-id/sign-in-with-pocket-id.png" alt="Sign in with Pocket ID" />

## Why use Pocket ID authentication?

Pocket ID authentication provides several advantages for organizations seeking a self-hosted identity solution:

- **Self-hosted control** - Full control over your authentication infrastructure and data
- **OIDC compliance** - Standard OpenID Connect implementation for seamless integration
- **Flexible deployment** - Deploy on any infrastructure that suits your needs
- **Automatic discovery** - Supports OIDC discovery for streamlined configuration
- **Simple configuration** - Intuitive setup process with minimal complexity
- **Data sovereignty** - Keep all authentication data within your infrastructure
- **Cost-effective** - No per-user pricing, perfect for growing organizations

---

## Prerequisites

Before configuring Pocket ID authentication, ensure you have:

- **Pocket ID instance** - A running Pocket ID server accessible via HTTPS
- **Admin privileges in Palmr** - Required to configure OIDC settings
- **Domain configuration** - For production deployments with custom domains

> **Note:** Pocket ID is pre-configured as an official provider in Palmr, which means the technical configuration is handled automatically. You only need to provide your OAuth credentials.

---

## Setting up Pocket ID Application

### Creating a Pocket ID application

To get started with Pocket ID authentication, you'll need to create an application in your Pocket ID admin interface.

1. **Navigate to Pocket ID Admin**: Go to your Pocket ID instance URL (e.g., `https://your-pocket-id.domain.com`)

<ZoomableImage src="/assets/v3/oidc/pocket-id/pocket-id-console.png" alt="Pocket ID Console" />

2. **Navigate to OIDC Clients**: Click **"OIDC Clients"** in the applications in the left sidebar, you will be redirected to the OIDC Clients page

<ZoomableImage src="/assets/v3/oidc/pocket-id/oidc-clients.png" alt="OIDC Clients" />

3. **Create a new OIDC Client**: Click **"Add OIDC Client"** button in the OIDC Clients page

<ZoomableImage src="/assets/v3/oidc/pocket-id/create-oidc-client-button.png" alt="Create OIDC Client Button" />

Configure the following settings:

- **Name**: "Palmr File Sharing" (or your preferred name)
- **Public Client**: "Diasabled"
- **PKCE**: "Disabled"
- **Logo**: "Upload a logo image"

<ZoomableImage src="/assets/v3/oidc/pocket-id/create-oidc-client.png" alt="Create OIDC Client" />

### Configuring application URLs

You'll need to configure several URLs in your Pocket ID application settings. Here's what to add for each environment:

### Redirect URIs

| Environment | URL |
| ----------- | ------------------------------------------------------------------ |
| Production | `https://yourdomain.com/api/auth/providers/pocketid/callback` |
| Development | `http://localhost:3000/api/auth/providers/pocketid/callback` |
| Custom Port | `https://yourdomain.com:5487/api/auth/providers/pocketid/callback` |

### Post Logout Redirect URIs

| Environment | URL |
| ----------- | ----------------------------- |
| Production | `https://yourdomain.com` |
| Development | `http://localhost:3000` |
| Custom Port | `https://yourdomain.com:5487` |

> **Note:** Replace `yourdomain.com` with your actual domain name in all production and custom port URLs.
> **Note:** You can add multiple redirect URIs for different environments (development, staging, production).

<ZoomableImage src="/assets/v3/oidc/pocket-id/config-urls.png" alt="Pocket ID Application URLs Configuration" />

### Getting OAuth credentials

After creating your application, you'll receive your OAuth credentials:

<ZoomableImage
src="/assets/v3/oidc/pocket-id/credentials.png"
alt="Pocket ID OAuth Credentials"
legend="The client ID and client secret shown in the image are examples only (fake credentials). You must use your own credentials from Pocket ID."
/>

Save these credentials securely - you'll need them to configure Palmr:

- Client ID
- Client Secret
- Provider URL (your Pocket ID instance URL)

---

## Configuring Palmr

### Accessing OIDC settings

To configure Pocket ID authentication in Palmr:

1. **Login as administrator**: Sign in to Palmr with an admin account
2. **Access settings**: Click your profile picture in the header and select **Settings**
3. **Navigate to authentication**: Find and click on the **Authentication Providers** section

<ZoomableImage src="/assets/v3/oidc/auth-providers.png" alt="Palmr Authentication Providers" />

### Enabling Pocket ID provider

1. **Locate Pocket ID**: Find Pocket ID in the list of available providers
2. **Enable the provider**: Toggle the status to **Enabled**

<ZoomableImage src="/assets/v3/oidc/pocket-id/enabled-pocket-id.png" alt="Palmr Pocket ID Provider Enabled" />

3. **Configure credentials**:
- **Provider URL**: Your Pocket ID server URL (e.g., `https://auth.yourdomain.com`)
- **Client ID**: Paste the Client ID from your Pocket ID application
- **Client Secret**: Paste the Client Secret from your Pocket ID application

<ZoomableImage
src="/assets/v3/oidc/pocket-id/edit-pocket-id.png"
alt="Edit Pocket ID Provider"
legend="This is a fake application, you have to use your own credentials."
/>

### Advanced configuration options

Configure additional settings to customize the authentication behavior:

**Auto Registration**: Enable to automatically create user accounts when someone authenticates for the first time.

**Sort Order**: Control where the Pocket ID login button appears relative to other authentication providers.

**Icon**: Choose a custom icon for the Pocket ID login button (default is `Key`).

<ZoomableImage src="/assets/v3/oidc/pocket-id/pocket-id-icon.png" alt="Pocket ID Icon" />

---

## Account linking

By default, if a user is already registered in Palmr with their Pocket ID email, they will be automatically linked to their Palmr account.

> **Note:** You can't disable account linking. If you want to unlink a user from their Pocket ID account, you need to delete the user from Palmr.

---

## Technical configuration

Pocket ID's technical configuration is handled automatically through OIDC discovery, but understanding the setup can help with troubleshooting:

```yaml
Provider Type: OAuth 2.0 with OIDC Discovery
Issuer URL: https://your-pocket-id.domain.com
Authorization Endpoint: /authorize
Token Endpoint: /api/oidc/token
UserInfo Endpoint: /api/oidc/userinfo
Scopes: openid profile email
```

### Field mappings

Palmr automatically maps Pocket ID user information to local user accounts:

- **User ID**: Maps from Pocket ID's `sub` field
- **Email**: Maps from Pocket ID's `email` field
- **Name**: Maps from Pocket ID's `name` field, falls back to `preferred_username`
- **First Name**: Maps from Pocket ID's `given_name` field
- **Last Name**: Maps from Pocket ID's `family_name` field
- **Avatar**: Maps from Pocket ID's `picture` field

---

## Testing the configuration

### Verifying the setup

After configuring Pocket ID authentication, test the integration:

1. **Check login page**: Verify the "Sign in with Pocket ID" button appears
2. **Test authentication flow**: Click the button and complete authentication
3. **Verify user creation**: Confirm new user account creation (if auto-registration is enabled)

### Login flow verification

The complete authentication process should work as follows:

1. User clicks "Sign in with Pocket ID"
2. User is redirected to Pocket ID login page
3. User authenticates with their credentials
4. Pocket ID redirects back to Palmr
5. Palmr creates or updates the user account
6. User gains access to Palmr

---

## Troubleshooting common issues

### Redirect URI mismatch

**Error**: `invalid_redirect_uri`

**Solution**:

1. Verify the exact callback URL in your Pocket ID application
2. Check for protocol mismatches (http vs https)
3. Ensure no trailing slashes unless specified
4. Add development URLs if testing locally

### Authentication failures

**Error**: `access_denied` or `unauthorized_client`

**Solution**:

1. Verify Client ID and Secret are correct
2. Check if the application is enabled in Pocket ID
3. Ensure required scopes are configured
4. Verify the user has necessary permissions

### Discovery endpoint issues

**Error**: Cannot fetch OIDC configuration

**Solution**:

1. Verify your Pocket ID server is accessible
2. Check if the discovery endpoint (`/.well-known/openid-configuration`) is available
3. Ensure SSL certificates are valid
4. Check network connectivity and firewall rules

---

## Security best practices

### Credential management

- **Secure storage**: Keep Client Secret secure and never commit to version control
- **Regular rotation**: Periodically rotate Client Secret
- **Environment variables**: Store credentials in environment variables
- **Access monitoring**: Regular review of authentication logs

### Production considerations

- **HTTPS required**: Always use HTTPS in production
- **Valid certificates**: Ensure SSL certificates are valid
- **Regular updates**: Keep Pocket ID server updated
- **Backup strategy**: Regular backups of Pocket ID configuration

---

## Next steps

After configuring Pocket ID authentication:

- **Monitor usage**: Track authentication patterns
- **Configure MFA**: Set up multi-factor authentication if needed
- **User management**: Review auto-registration settings
- **Backup verification**: Test backup and restore procedures

For more information about OIDC authentication in Palmr, see the [OIDC Authentication overview](/docs/3.1-beta/oidc-authentication).

## Useful resources

- [Pocket ID Documentation](https://docs.pocket-id.org)
- [OIDC Specification](https://openid.net/specs/openid-connect-core-1_0.html)
- [Palmr OIDC Overview](/docs/3.1-beta/oidc-authentication)
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "palmr-docs",
"version": "3.1-beta",
"version": "v3.1.1-beta",
"description": "Docs for Palmr",
"private": true,
"author": "Daniel Luiz Alves <daniel@kyantech.com.br>",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/docs/public/assets/v3/screenshots/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion apps/docs/src/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>

const MDXContent = page.data.body;

// Check if this is an older version page that needs a warning
const shouldShowWarning = page.url.startsWith("/docs/2.0.0-beta");

return (
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/src/components/OIDCProviderCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ const providers = [
href: "/docs/3.1-beta/oidc-authentication/kinde-auth",
icon: <Users className="w-4 h-" />,
},
{
name: "Pocket ID",
description: "Open-source identity provider with OIDC support",
href: "/docs/3.1-beta/oidc-authentication/pocket-id",
icon: <Key className="w-4 h-4" />,
},
{
name: "Other",
description: "Configure any other OIDC-compliant identity provider",
Expand Down
6 changes: 5 additions & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "palmr-api",
"version": "3.1-beta",
"version": "v3.1.1-beta",
"description": "API for Palmr",
"private": true,
"author": "Daniel Luiz Alves <daniel@kyantech.com.br>",
Expand Down Expand Up @@ -51,7 +51,9 @@
"node-fetch": "^3.3.2",
"nodemailer": "^6.10.0",
"openid-client": "^6.6.2",
"qrcode": "^1.5.4",
"sharp": "^0.34.2",
"speakeasy": "^2.0.0",
"zod": "^3.25.67"
},
"devDependencies": {
Expand All @@ -61,6 +63,8 @@
"@types/bcryptjs": "^2.4.6",
"@types/node": "^22.13.4",
"@types/nodemailer": "^6.4.17",
"@types/qrcode": "^1.5.5",
"@types/speakeasy": "^2.0.10",
"@typescript-eslint/eslint-plugin": "8.35.1",
"@typescript-eslint/parser": "8.35.1",
"eslint": "9.30.0",
Expand Down
Loading