Skip to content

docs(ai): AI with Leantime section, with a tested Keycloak SSO walkthrough - #66

Merged
gloriafolaron merged 3 commits into
masterfrom
docs/ai-with-leantime
Nov 15, 2026
Merged

gloriafolaron merged 3 commits into
masterfrom
docs/ai-with-leantime

Conversation

@gloriafolaron

Copy link
Copy Markdown
Contributor

Adds an AI with Leantime section (ai/) and puts the MCP guide under it in the sidebar.

Page What it's for
ai/README.md (overview) The two halves: AI helping you set up and run Leantime, and AI working inside Leantime (MCP)
ai/working-with-ai.md How to give an assistant the real docs (every page has a .md version), what never to paste, how to check its answers, a starter prompt
ai/glossary.md Plain-language definitions of the words people meet when self-hosting: reverse proxy, volume, recreate, issuer, redirect URI, PKCE… Written for beginners, and it gives AI assistants the same vocabulary
ai/keycloak-sso.md Keycloak single sign-on with Leantime's built-in OIDC, step by step, with the prompts to use

How the Keycloak guide was tested

An AI assistant (Claude Code) set it up from scratch on Leantime 3.14.0 and Keycloak 26.8.2 in Docker, through Keycloak's admin screens. It ended with a Keycloak user signed in to Leantime and given an account as Editor (role 20, source = oidc). Every Keycloak label in the guide is the one on screen in 26.8.

It hit two real errors, both now in the guide with their fixes:

  1. The received provider … does not match the local setting …: LEAN_OIDC_PROVIDER_URL must equal the token's issuer exactly. On one machine this needs LEAN_OIDC_AUTO_DISCOVER, a setting that exists in core (Environment.php) but isn't in config/sample.env or the auth docs.
  2. Your identity provider reports that the email address of your account is not verified.: Keycloak users need Email verified.

It also confirmed PKCE works with Keycloak's Require PKCE on, and that Keycloak returns Invalid parameter: redirect_uri for a wrong callback.

Mobile app: core OIDC brokers mobile sign-in only when AdvancedAuth is enabled (Oidc/Controllers/Login.php:50). The guide says so; Keycloak needs nothing extra.

Follow-ups

🤖 Generated with Claude Code

https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

…rough

- Overview: AI helping you run Leantime, and AI working in Leantime (MCP).
- Working with AI assistants: giving the assistant the real docs (.md pages),
  what never to paste, how to check answers, a starter prompt.
- Glossary of hosting, Docker, configuration and sign-in terms.
- Keycloak single sign-on with Leantime's built-in OIDC, carried out end to end
  by an AI assistant on Leantime 3.14.0 + Keycloak 26.8.2 (Docker): exact
  Keycloak 26 labels, PKCE, the two errors it hit (issuer mismatch, unverified
  email) with fixes, LEAN_OIDC_AUTO_DISCOVER for one-machine tests, the mobile
  app note (needs AdvancedAuth) and prompts to use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Keycloak guide requires PKCE on versions that do not support it, risking sign-in failures, while the glossary incorrectly equates API key service accounts with personal user identities.

2 open issues
What changed in this PR

Adds an AI with Leantime documentation section covering AI-assisted administration and connecting assistants to Leantime through MCP.

Changes:

  • Introduces guidance on sharing documentation, protecting secrets, and checking AI-generated advice.
  • Adds a beginner glossary and a Keycloak OIDC walkthrough with troubleshooting and assistant prompts.
  • Groups the new pages and existing MCP guide in the sidebar.
File Description
ai/​working-with-ai.md Practical guidance for using AI assistants safely and checking their answers.
ai/​README.md Overview linking AI-assisted administration and MCP integration.
ai/​keycloak-sso.md Keycloak setup steps, troubleshooting, and AI prompts.
ai/​glossary.md Plain-language definitions for hosting, configuration, and authentication.
_sidebar.md Adds the AI section and links to its guides and MCP documentation.

Review effort: Balanced

Comment thread ai/glossary.md Outdated

**Two-factor authentication (2FA).** A second step at login, usually a code from an authenticator app.

**API key** / **personal access token.** A long secret that lets a script or AI assistant use Leantime's API in your name. Treat it like a password.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 028203e.

Comment thread ai/keycloak-sso.md Outdated

- **Time:** about 30 minutes
- **Level:** Some experience. You can edit Leantime's settings and you have an administrator account in Keycloak.
- **You need:** Leantime 3.13 or later, a Keycloak server, and access to Leantime's `.env` file (or its Docker environment).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 028203e.

gloriafolaron and others added 2 commits November 12, 2026 01:48
…for PKCE)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi
Leantime trims it from both LEAN_OIDC_PROVIDER_URL and the token's iss
before comparing (Oidc::trimTrailingSlash), matching #60.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants