Wiki source code of Agent Authentication
Last modified by superadmin on 2026/11/25 21:27
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | An AI assistant connected to the [[MCP server>>doc:documentation.extensions.user.llm.mcp-server.WebHome]] can read exactly what your user can read and edit exactly what your user can edit. There is no separate "AI permission" that adds power. The [[document history>>doc:documentation.xs.user.page-history.view-history.WebHome]] records your user as the author of any changes. | ||
| 2 | |||
| 3 | How the assistant comes to act as your user: | ||
| 4 | |||
| 5 | {{plantuml}} | ||
| 6 | @startuml | ||
| 7 | |||
| 8 | actor "You" as YOU | ||
| 9 | participant "Your AI assistant" as AGENT | ||
| 10 | participant "Your wiki" as WIKI | ||
| 11 | |||
| 12 | AGENT -> WIKI : asks to connect to the wiki's MCP address | ||
| 13 | alt the wiki allows guest access, and the assistant sends no credentials | ||
| 14 | WIKI --> AGENT : served as the anonymous guest | ||
| 15 | AGENT -> WIKI : reads pages | ||
| 16 | WIKI --> AGENT : only what a guest may view | ||
| 17 | else the assistant signs in | ||
| 18 | WIKI --> AGENT : not yet, this needs a wiki user | ||
| 19 | AGENT -> YOU : opens a sign-in page in your browser | ||
| 20 | YOU -> WIKI : signs in and allows the assistant | ||
| 21 | WIKI --> AGENT : connected, as your user | ||
| 22 | AGENT -> WIKI : reads and edits pages | ||
| 23 | WIKI --> AGENT : only what your user is allowed to see and change | ||
| 24 | end | ||
| 25 | @enduml | ||
| 26 | {{/plantuml}} | ||
| 27 | |||
| 28 | == Guest access == | ||
| 29 | |||
| 30 | Guest access is off by default. Where a wiki administrator allows it, an assistant that connects without signing in is served as the anonymous guest user: it can call the read tools, and it never receives a write tool, whatever the wiki enables. A request that carries credentials which fail to authenticate is still refused with a ##401##, so an expired token never silently falls back to guest. | ||
| 31 | |||
| 32 | == Sign-in requirements == | ||
| 33 | |||
| 34 | The browser sign-in above needs the XWiki OIDC Provider on the wiki, with "Token based authenticator" as the wiki's authentication service; the administrator sets it up as part of [[Set Up MCP Authentication>>doc:documentation.extensions.admin.llm.mcp-server.set-authentication.WebHome]]. Without it, there is no sign-in flow to follow: an unauthenticated caller gets a bare ##401## unless the wiki allows guest access, and the client must send credentials itself, for example HTTP Basic where the wiki accepts it. | ||
| 35 | |||
| 36 | == Single sign-on == | ||
| 37 | |||
| 38 | When your wiki signs users in through your organization's identity provider, the sign-in page your assistant opens is that provider's login page. After you sign in, the wiki asks you to allow the assistant, and the assistant receives a token from the wiki, not from the identity provider. | ||
| 39 | |||
| 40 | == How long access lasts == | ||
| 41 | |||
| 42 | The token your assistant receives does not expire. It stays valid until you delete it in the "Applications" section of your user profile, which lists every assistant you allowed. Signing out of the wiki or of your organization's identity provider does not revoke it. | ||
| 43 | |||
| 44 | == Practical consequences == | ||
| 45 | |||
| 46 | * If your user can edit a space, the assistant can edit that space. | ||
| 47 | * Rights are the hard boundary. Configuration settings (tool enablement, space filters) can only narrow what the assistant can do below your rights, never widen it. | ||
| 48 | |||
| 49 | == Cross-wiki reach == | ||
| 50 | |||
| 51 | When cross-wiki reach is enabled, the assistant can access documents on other wikis in the farm. Access is still governed by the rights of the account the assistant acts as on those target wikis. |