Waterhole 0.4 is here with new integrations: single sign-on with external authentication providers, and integration into existing Laravel apps.
Highlights
The focus of the 0.4 release is authentication and Laravel integration, making it possible to use Waterhole with your existing user base. There are also a number of other changes and bug fixes which are detailed in the Release Notes.
Single Sign-On
If you have an external site with an existing user base and authentication system that you would like to use, Waterhole now includes a special authentication provider to support this flow.
The updated Authentication docs describe how to set this up, including making the necessary configuration changes to Waterhole and configuring your external site to respond.
If your website uses PHP, you can use the new waterhole/sso
package to handle SSO requests for you, making it as easy as this:
use Waterhole\Sso\PendingUser;
use Waterhole\Sso\WaterholeSso;
Route::middleware('auth', 'verified')->get('sso', function () {
$sso = new WaterholeSso('sso_secret');
$user = Auth::user();
$sso->authenticate(
new PendingUser(
identifier: $user->id,
email: $user->email,
name: $user->name,
avatar: $user->avatar_url,
)
);
});
Laravel Integration
If you have an existing Laravel application and user base, you can now install Waterhole into your project as a package, and automatically authenticate your users. Currently only Laravel 10 is supported.
Check out the new Laravel Integration docs to learn how to set this up. After installing and configuring Waterhole, setting up the authentication integration is as easy as adding an interface and a trait to your application's User model:
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Waterhole\Auth\AuthenticatesWaterhole;
use Waterhole\Auth\HasWaterholeUser;
class User extends Authenticable implements AuthenticatesWaterhole
{
use HasWaterholeUser;
}
Upgrading From 0.3
This release contains breaking changes listed in the Release Notes. Before upgrading, you should review this list and make appropriate updates to your customizations.
There are also changes to the Waterhole configuration files. While many of these changes are not required, you may wish to review them and keep your project's configuration files in sync.
One configuration change is required. In the config/waterhole/auth.php
file, rename the oauth_providers
key to providers
:
- 'oauth_providers' => [
+ 'providers' => [
Also, if you are using any auth providers, you will need to change the redirect
URLs in config/services.php
from /oauth/{provider}/callback
to /auth/{provider}/callback
:
- 'redirect' => '/oauth/github/callback',
+ 'redirect' => '/auth/github/callback',
Now in your composer.json
file, change the waterhole/core
requirement:
- "waterhole/core": "^0.3"
+ "waterhole/core": "^0.4"
Then run:
composer update waterhole/core --with-dependencies
php artisan migrate
php artisan waterhole:cache:clear
What's Next
The next release, 0.5, will introduce a comprehensive JSON API so you can read and write forum data outside of Waterhole. It will also bring some changes to the extension API to improve performance and stability.
7 Comments
Awesome @Toby thanks for the update and all you hard work!
This is exactly what I've been waiting for to give waterhole a try
Awesome work @Toby! The more familiar I get with Waterhole, the more I'm liking it
Hey @Toby! Any update on the next update? It's been a while. I like it as it is, but would certainly like to see more frequent development cycles. Cheers!
Hi @René, thanks for checking in! Absolutely, I'm disappointed that I haven't been able to get the next release out the door yet. I think a combination of life being busy and the changes slated being relatively large/overwhelming has made it hard to find the chunks of time needed. I appreciate the nudge and am going to make a more concerted effort over the next month - stay tuned.
Any ETA on the next update? (not pushing, just curious)
No ETA, but can confirm that the JSON API implementation is mostly complete (it will be read-only for now), as well as the changes to the extension API. It's not a particularly exciting release, but it's coming!