๐ Pocket ID Authentication
Seamlessly integrate Pocket ID as your single sign-on (SSO) provider for Booklore. Simplify user authentication, enhance security, and provide a streamlined login experience across your applications.
The username in Pocket ID must exactly match the username in Booklore for authentication to work properly. Case sensitivity matters. If a user doesn't exist in Booklore with the matching username, authentication will fail.
๐ What You'll Achieveโ
With Pocket ID integration, you can:
- Enable single sign-on (SSO) for seamless access to Booklore without separate login credentials
- Centralize user management across multiple applications from one unified interface
- Enhance security with OAuth2/OpenID Connect protocols and modern authentication standards
- Simplify login experience for your users with automatic session management
- Control access through OIDC client configuration and user permissions
- Streamline deployment with Pocket ID's lightweight and easy-to-configure architecture
โจ How Pocket ID Integration Worksโ
๐ The Authentication Flowโ
Understanding the authentication flow helps troubleshoot issues and explains what happens behind the scenes:
-
๐ซ User Initiates Login
User attempts to access Booklore and is redirected to Pocket ID's secure login portal. The original destination URL is preserved for automatic redirect after authentication. -
๐ Pocket ID Authenticates
User enters credentials in Pocket ID's login page. Pocket ID validates the credentials against its user directory and verifies the user's identity. -
โ Token Exchange
Pocket ID validates credentials and issues OAuth2 tokens (access token, ID token). These tokens contain user information and are cryptographically signed for security. -
๐ช Access Granted
Booklore receives and validates the tokens, extracts user information, matches it with an existing Booklore user account, and grants access to the authenticated user.
๐ Setting Up Pocket IDโ
Step 1: Create OIDC Client in Pocket IDโ
Begin by configuring Booklore as an OIDC client in Pocket ID. This process should take about 5 minutes:
-
Navigate to OIDC Clients
Open your Pocket ID admin panel and navigate to Settings โ Administration โ OIDC Clients. Click the "Add OIDC Client" button to begin the setup process.
-
Configure Client Details
Fill in the OIDC client configuration form with the following information:

- Name:
Booklore(or your preferred name) - This name will be displayed to users in the Pocket ID dashboard - Callback URLs: Configure the redirect URIs where Pocket ID should send users after authentication:
https://<your-booklore-domain>/oauth2-callback- The exact callback endpoint (trailing slash required)https://<your-booklore-domain>/*- Pattern allowing flexibility for various OAuth flows
- Public Client: Toggle ON - Public clients are suitable for applications running in browsers
- Client Launch URL:
https://<your-booklore-domain>/- The main URL where your Booklore instance is hosted - Click Save to create the client
Important: Callback URL FormatEnsure the trailing slash is included in the callback URL. Use your actual domain without brackets or placeholders. Incorrect redirect URIs are the most common cause of authentication failures.
Example for a production setup:
Callback URLs:
- https://books.example.com/oauth2-callback
- https://books.example.com/*
Client Launch URL: https://books.example.com/Example for local testing:
Callback URLs:
- http://localhost:3000/oauth2-callback
- http://localhost:3000/*
Client Launch URL: http://localhost:3000/Public Client TypePublic client type is appropriate for applications where the client secret cannot be kept confidential. Booklore's frontend needs to initiate the OAuth flow, making this the correct choice.
- Name:
Step 2: Retrieve Client Credentialsโ
After creating the OIDC client, you'll need to copy the credentials for Booklore configuration:

-
Copy Client ID
After saving the client configuration, a Client ID will be automatically generated. This is a unique identifier for your Booklore application.- Copy this Client ID to a secure location
- You'll need this in the next step to configure Booklore
-
Note the Issuer URL
Your Pocket ID issuer URL will be:https://<your-pocket-id-domain>/- Make sure to include the trailing slash
- This is the base URL where your Pocket ID instance is hosted
Copy the Client ID and note your Pocket ID domain. You'll paste these into Booklore in the next step. Keep this information secure as it's required to establish the connection.
โ๏ธ Configuring Bookloreโ
Step 3: Connect Booklore to Pocket IDโ
Now configure Booklore to use Pocket ID as the authentication provider. This is the final configuration step:

-
Open Booklore Settings
Navigate to Settings โ Authentication in your Booklore admin interface. You'll need administrator privileges to access this section. -
Configure OIDC Provider
In the OIDC Authentication section, enter the following details:
- Provider Name:
Pocket ID(or your preferred display name)- This name appears on the login button, so make it recognizable to users
- Client ID: Paste the Client ID you copied from Pocket ID
- Ensure there are no extra spaces before or after
- Issuer URL: Enter your Pocket ID URL:
https://<your-pocket-id-domain>/- Must include the trailing slash
- Example:
https://auth.example.com/
- Click Save to store the configuration
- Provider Name:
-
Enable OIDC Authentication
Toggle "OIDC Enabled" to ON to activate Pocket ID authentication- When enabled, users will see a "Login with Pocket ID" button on the Booklore login page
- The standard username/password login will still be available unless specifically disabled
Booklore is now configured to use Pocket ID for authentication. The next step is testing the integration to ensure everything works correctly.
๐งช Testing the Integrationโ
Step 4: Test Login with Pocket IDโ
Verify that the integration works correctly before rolling it out to users. Testing ensures a smooth experience:
-
Access Pocket ID Dashboard
Navigate to Settings โ My Apps in your Pocket ID admin panel. You should see the Booklore application card displayed.

-
Launch Booklore
Click on the "Booklore" app card to initiate authentication. Pocket ID will automatically handle the OAuth flow and redirect you to Booklore.

-
Verify Successful Login
- You should be automatically logged into Booklore
- Check that your username and email are displayed correctly
- Verify that you have access to your expected content and permissions
- Test logging out and logging back in to ensure session handling works
Alternative Testing Method:
- Open an incognito/private browser window
- Navigate to your Booklore instance
- Click "Login with Pocket ID" (or your configured provider name)
- You'll be redirected to Pocket ID for authentication
- After logging in, you should be redirected back to Booklore
Your Pocket ID integration is working correctly. You can now roll it out to your users.
๐ Managing Authenticationโ
Disabling Pocket ID Authenticationโ
If you need to temporarily disable or switch authentication methods (for maintenance or troubleshooting):

-
Navigate to Authentication Settings
Go to Booklore โ Settings โ Authentication -
Disable OIDC
Toggle "OIDC Enabled" to OFF- This immediately disables Pocket ID authentication
- Active sessions remain valid until they expire
- New login attempts will use standard authentication
-
Log Out
Click Logout to end your current session and verify the change -
Standard Login Returns
You'll be redirected to the standard Booklore login page with username/password fields

Disabling OIDC doesn't delete your Pocket ID configuration. All settings (Client ID, Issuer URL) are preserved. You can re-enable it anytime by toggling the switch back on. Users who were authenticated via Pocket ID can still log in with standard credentials if they have them configured.
๐ ๏ธ Troubleshootingโ
Common Issues and Solutionsโ
Authentication Fails:
- โ Verify usernames match exactly between Pocket ID and Booklore (case-sensitive)
- โ Check callback URLs include trailing slashes
- โ Ensure user exists in both Pocket ID and Booklore
- โ Verify Client ID is correctly copied (no extra spaces)
- โ Check browser console for errors (F12)
Redirect Errors:
- โ Verify callback URL:
/oauth2-callback(with trailing slash) - โ Confirm domain matches exactly in both systems
- โ Ensure HTTPS is used in production
- โ Validate wildcard pattern:
https://your-domain/*
User Not Found:
- โ Create matching username in Booklore (case-sensitive)
- โ Verify user account is active in Pocket ID
- โ Check that email addresses match between systems
"Invalid Client" Error:
- โ Check Client ID is copied correctly (no extra spaces)
- โ Verify "Public Client" is toggled ON in Pocket ID
- โ Ensure Issuer URL ends with trailing slash
Connection Refused:
- โ Verify Pocket ID service is running and accessible
- โ Check network connectivity between Booklore and Pocket ID
- โ Ensure firewall rules allow communication
- โ Validate DNS resolution for both domains
SSL/Certificate Errors:
- โ Ensure valid SSL certificates on both systems
- โ Verify Issuer URL uses HTTPS in production
- โ Check certificate chains are properly configured
- โ Validate certificate expiration dates
Viewing Logsโ
Pocket ID: Check application logs for OAuth-related events and errors
Booklore: Review authentication logs in the application logs directory
๐ฏ Best Practicesโ
Security Recommendationsโ
- ๐ Use HTTPS - Always use HTTPS in production with valid SSL certificates
- ๐ Secure Credentials - Store Client IDs securely and never expose them in public repositories
- ๐ก๏ธ Keep Updated - Regularly update both Pocket ID and Booklore to patch security vulnerabilities
- ๐ Monitor Activity - Track login attempts and set up alerts for unusual patterns
- ๐ Rotate Credentials - Periodically regenerate Client IDs, especially after personnel changes
- ๐ช Restrict Access - Configure callback URLs as specifically as possible
- ๐ฅ Review Users - Regularly audit user accounts and remove inactive users
Optimization Tipsโ
- ๐ Use descriptive names - Name OIDC clients clearly (e.g., "Booklore Production")
- ๐ Use reverse proxy - Add rate limiting and IP whitelisting for additional security
- ๐ Test in staging - Validate changes in a staging environment before production
- โก Optimize tokens - Configure appropriate token expiration times
- ๐ Document setup - Keep detailed records of your configuration for troubleshooting
User Experienceโ
- ๐จ Customize branding - Configure Pocket ID with your organization's branding
- ๐ Document the process - Create user guides with screenshots and support contact info
- ๐ Provide support - Ensure users know how to get help with authentication issues
- ๐ Test regularly - Periodically verify the authentication flow works as expected
๐ Additional Resourcesโ
- Pocket ID Documentation: Official documentation for Pocket ID configuration
- OAuth 2.0 Specification: Understanding the protocol behind SSO
- OpenID Connect Core: Detailed information about OIDC flows
- Security Best Practices: Regular security audits and penetration testing
Pocket ID provides lightweight, efficient authentication with minimal configuration. Once set up, your users will have secure, streamlined access to Booklore with the convenience of single sign-on and the simplicity of centralized authentication management.