OAuth | |
|
Tiki implements OAuth in multiple ways, both as a consumer (client) connecting to external OAuth providers, and as an OAuth 2.0 server (provider) allowing external applications to authenticate and access Tiki's API. | |
Overview | |
|
OAuth (Open Authorization) is an open standard for access delegation, commonly used as a way for Internet users to grant websites or applications access to their information on other websites without giving them the passwords. Tiki supports multiple OAuth implementations to accommodate different provider requirements. The system implements OAuth 1.0 for Zotero integration, which uses the older but still widely supported OAuth 1.0 protocol. For modern providers like Twitter and Vimeo, as well as for Tiki's own OAuth server functionality, the system uses OAuth 2.0, which provides improved security and user experience. Additionally, Tiki includes custom OAuth flows specifically tailored for Facebook and LinkedIn, which have unique requirements that don't fit neatly into the standard OAuth 1.0 or 2.0 specifications. Tiki uses the PHP League OAuth libraries for OAuth 2.0 implementation, which was added in Tiki20 for use with Converse (XMPP chat). | |
Supported Providers | |
1.1.1. Zotero | |
|
Zotero integration enables researchers and academics to seamlessly access their bibliographic references stored in Zotero libraries directly from Tiki. Users can retrieve references by tag, access individual library items, and format citations in various academic styles including BibTeX. This integration uses OAuth 1.0, which is Zotero's supported authentication method. Configuration
Usage: Copy to clipboard
Zotero uses OAuth 1.0, which requires a three-step authentication process. The request token is obtained from https://www.zotero.org/oauth/request, followed by user authorization at https://www.zotero.org/oauth/authorize, and finally token exchange at https://www.zotero.org/oauth/access. Once authenticated, API requests are made to https://api.zotero.org to retrieve bibliographic data. | |
1.1.2. Facebook | |
|
Facebook integration provides multiple capabilities including allowing users to log in using their Facebook credentials and retrieving Facebook feeds for display within Tiki. The integration can also automatically create Tiki user accounts when users first log in via Facebook, streamlining the registration process. Unlike the other providers, Facebook uses a custom OAuth implementation rather than the standard OAuthLib class, which provides more flexibility for Facebook's specific requirements. Configuration:
Usage: Copy to clipboard
| |
1.1.3. Vimeo | |
|
Vimeo integration lets users upload videos to their Vimeo account from Tiki’s file gallery, the Vimeo wiki plugin, or tracker fields configured for Vimeo. Users must authorize Tiki with Vimeo once; thereafter the integration can request quota, create upload tickets, complete uploads, and manage video metadata (title, delete). This integration uses OAuth 2.0. Configuration:
In the Enhancement section, enable:
Then set the following values:
These credentials are obtained from your Vimeo Developer application. Step 2: Create a Vimeo Application
The callback URL format must be: Copy to clipboard
Replace your-tiki-site.tld with your actual domain name. Usage: Copy to clipboard
Vimeo OAuth 2.0 uses https://api.vimeo.com/oauth/authorize for authorization and https://api.vimeo.com/oauth/access_token for the token exchange. API requests are made to https://api.vimeo.com (e.g. /me, /me/videos, /videos/{id}). The token is stored in the user preference oauth_token_vimeo. | |
1.1.4. XMPP / ConverseJS | |
|
When XMPP is enabled and the authentication method is set to: xmpp_auth_method = 'oauth'
Configuration
Configure the following:
OAuth Client Details
This internal client is used by ConverseJS for OAuth authentication. | |
1.1.5. PeerTube | |
|
PeerTube integration allows Tiki to upload and manage videos on a PeerTube instance, including listing channels, uploading videos, and retrieving video lists. PeerTube authentication in Tiki is based on OAuth 2.0 using the Resource Owner Password Credentials grant. Unlike Vimeo or other OAuth providers, Tiki does not use a user-facing "connect your account" flow. There is no redirect or consent screen. Instead, the administrator configures a single PeerTube account (username and password) in Tiki. When an authenticated request is required, Tiki retrieves the public local OAuth client from the PeerTube instance and performs a server-side token exchange using the configured credentials. This means OAuth 2.0 is used internally, but entirely without browser redirection. Configuration
Copy to clipboard
The retrieved client configuration is cached in the session. Token Exchange Process
Copy to clipboard
Tiki sends a server-side request with:
Copy to clipboard
Copy to clipboard
The local OAuth client belongs to the PeerTube instance and is intended for trusted or server-to-server usage. It is independent from Tiki’s own OAuth server and different from the OAuth flows used for providers such as Vimeo or Zotero. | |
Tiki20 | |
|
https://oauth2.thephpleague.com/ was added for use with Converse in Tiki20. Some related commits: | |