Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Contao Discourse

Contao Discourse Laravel Package

craffft/contao-discourse

View on GitHub
Deep Wiki
Context7

Discourse extension for Contao: Single Sign On

Frequently asked questions about Contao Discourse
Does this package work with Laravel, or is it strictly for Contao/Symfony?
This package is designed for Contao 4+ (Symfony-based) and won’t work natively in Laravel. However, if your Laravel app uses Symfony components (e.g., security bundles), you could adapt the OAuth2 logic for SSO. For pure Laravel, consider alternatives like `spatie/laravel-discourse` or custom OAuth2 implementations.
What Laravel versions or Symfony-based Laravel packages can integrate with this?
Since this bundle targets Contao 4+ (Symfony 5+), it’s incompatible with vanilla Laravel. If you’re using Laravel with Symfony bundles (e.g., `symfony/http-client` or `symfony/security-bundle`), you might repurpose the OAuth2 logic, but direct integration isn’t supported. For Laravel-native Discourse SSO, explore `spatie/laravel-discourse` or `laravel/socialite`.
How do I configure the Discourse SSO secret and callback URL?
After installing via Composer, configure the bundle in Contao’s backend (likely via a manager module or `config.yml`). Set your Discourse SSO secret (found in Discourse admin settings), callback URL (e.g., `https://your-contao-site.com/discourse-sso/callback`), and Discourse base URL. The README or bundle docs should specify the exact config path—check for `craffft_contao_discourse` parameters.
Will this handle user provisioning/deprovisioning automatically, or do I need to set up webhooks?
This package focuses solely on SSO authentication, not user lifecycle management. You’ll need to manually handle user provisioning/deprovisioning in Discourse, either via Discourse’s API or by setting up webhooks in Discourse to sync with Contao’s `tl_member` table. Consider using Discourse’s admin API or a cron job for periodic syncs if needed.
Does this support Contao 3.x or only Contao 4+ with Symfony?
This bundle **only supports Contao 4+** (Symfony 5+). Contao 3.x uses a different architecture and lacks Symfony’s security components, so integration would require a complete rewrite. If you’re on Contao 3.x, evaluate alternatives like custom OAuth2 implementations or migrating to Contao 4+ for compatibility.
How do I test the SSO flow before deploying to production?
Test the SSO flow locally by logging into Contao, then triggering the Discourse SSO redirect (likely via a custom button or menu item). Verify the callback URL receives the OAuth2 token, Contao validates it, and users are redirected back. Use Discourse’s test mode (if available) to simulate SSO without real user creation. Check logs for errors during the OAuth2 handshake.
Can I customize the SSO button or redirect behavior in Contao’s frontend?
Yes, you can customize the SSO button or link by extending the bundle’s templates or overriding its Twig/Blade logic. The bundle likely provides hooks or events for modifying the login flow (e.g., `craffft_contao_discourse.login_button`). Check the bundle’s documentation for template paths or event names. For Contao, this may involve editing a module or creating a custom DCA field.
What happens if a user logs out of Discourse but stays logged into Contao?
This package doesn’t enforce session synchronization between Contao and Discourse. If a user logs out of Discourse but remains logged into Contao, they’ll still access Contao until their Contao session expires. For tighter integration, you’d need to implement a logout endpoint in Contao that triggers Discourse’s logout via its API or by clearing the SSO token locally.
Are there any performance concerns with adding this to a high-traffic Contao site?
The bundle adds minimal overhead, primarily during the OAuth2 handshake (token validation, user lookup). Monitor authentication latency post-integration, especially if Discourse’s API is hosted remotely. Cache Discourse’s public key (if used) and avoid redundant API calls. For high-traffic sites, test under load to ensure the SSO flow doesn’t bottleneck Contao’s login process.
What alternatives exist for Discourse SSO in Laravel/Contao if this bundle isn’t a fit?
For Laravel, use `spatie/laravel-discourse` (official Laravel wrapper) or `laravel/socialite` with Discourse’s OAuth2 provider. For Contao, if this bundle lacks features, consider: 1) **Custom OAuth2**: Build a Symfony bundle using `league/oauth2-client` to mirror the SSO logic. 2) **Discourse API**: Use Discourse’s API directly for user management (e.g., `guzzlehttp/guzzle`). 3) **Contao Extensions**: Check for other Contao-Discourse bridges or hire a developer to extend this bundle.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky