Closed m-lotze closed 4 years ago
Definitely a great idea to support the JWT flow at some point. Just haven't seen it generate a lot of interest.
I actually like the file/database alternative too. The package is pretty open to any type of storage as long as it implements src/Omniphx/Forrest/Interfaces/StorageInterface.php
The package is pretty open to any type of storage as long as it implements src/Omniphx/Forrest/Interfaces/StorageInterface.php
That is right, but i think it is kind of hard to add your own storage class. Maybe i am missing something, but think it would be much easier, if you could add a config option like 'storage.class' => MyStorage::class, 'storage.type' => 'custom'
. And change the method getStorageType
to something like this:
protected function getStorage($storageType)
{
$customStorage = config('forrest.storage.class');
if ($storageType === 'custom'
&& class_exists($customStorage) && new $customStorage() instanceof StorageInterface) {
return new $customStorage();
}
switch ($storageType) {
case 'session':
$storage = new LaravelSession(app('config'), app('request')->session());
break;
case 'cache':
$storage = new LaravelCache(app('config'), app('cache')->store());
break;
default:
$storage = new LaravelSession(app('config'), app('request')->session());
}
return $storage;
}
I was looking for this as well. I already have it setup for my app, but I don't really want to rewrite all the endpoints that your lib offers.
Do you develop it ? Can I have your connexion with JWT ?
JWT authentication is implemented in Version 2.10.0. Setup guide here: https://github.com/omniphx/forrest#jwt-authentication-flow
Are there any plans to also implement the JWT bearer flow for server-to-server integration? https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.htm&type=5
Or could you maybe add a file/database store option, so the token does not get lost on
php artisan cache:clear
? i need a way to setup authentication once and have it working from there on, without the need to reauthenticate when the cache gets cleared.