City
Identity
How City manages user identity, authentication, and permissions
Identity
City manages global user identity, authentication, and permissions. This is shared infrastructure that all Agents and products connect to, rather than being replicated in every project.
What City owns
- User accounts — global downcity accounts with profile and credentials
- API tokens — scoped tokens for programmatic access
- Permissions — role-based access control for resources and actions
- Channel accounts — bot credentials for Telegram, Feishu, QQ, etc.
Authentication flow
- User logs in via Console or CLI
- City issues an identity token
- The token is used for all subsequent API calls
- Agents validate tokens through City when serving HTTP requests
Channel accounts
Bot credentials for messaging platforms are stored in ~/.downcity/downcity.db and referenced by ID from the project:
{
"plugins": {
"chat": {
"channels": {
"telegram": {
"channelAccountId": "telegram-main"
}
}
}
}
}Continue with: