Moin,

ich möchte Daten aus der Datenbank an eine App übergeben. In Symfony ist das mit Api Platform und lexik/jwt-bundle kein Problem.
Wie genau gehe ich aber nun in contao vor?

Meine Idee war nun ein Custom Authenticator + eigene firewall + benutzerdefinierte /api routes

1. custom authenticator (https://docs.contao.org/dev/framewor...mfony-firewall) Problem hierbei: die lexik authentication handlers werden nicht gefunden, gibt es hier seitens contao bereits vorhandene?
PHP-Code:
namespace Vendor\MyBundle\ContaoManager;

class 
Plugin implements ExtensionPluginInterface 
{
    
// other stuff

    
public function getExtensionConfig($extensionName, array $extensionConfigsContainerBuilder $container)
    {
        
        if (
'security' !== $extensionName) {
            return 
$extensionConfigs;
        }
        foreach (
$extensionConfigs as &$extensionConfig) {
            if (isset(
$extensionConfig['firewalls'])) {
                
                
$extensionConfig['providers']['app.api_user_provider'] = [
                    
'id' => 'app.security.api_user_provider'
                
];
                
                
$offset = (int) array_search('frontend'array_keys($extensionConfig['firewalls']));
                
                
$extensionConfig['firewalls'] = array_merge(
                    
array_slice($extensionConfig['firewalls'], 0$offsettrue),
                    [
                        
'login' => [
                            
'pattern' =>  "^/api/login",
                            
"stateless" => true,
                            
"json_login" => [
                                
"provider" => "app.api_user_provider",
                                
"check_path" => "/api/login_check",
                                
"success_handler" => "lexik_jwt_authentication.handler.authentication_success",
                                
"failure_handler" => "lexik_jwt_authentication.handler.authentication_failure"
                            
],
                            
"provider" => 'app.api_user_provider'
                        
],
                        
'api' => [
                            
'pattern' => '/api/*',
                            
'stateless' => true,
                            
/*"jwt" => "~"
                            'custom_authenticators' => [
                                'app.security.api_user_provider'
                                
                            ],
                            "provider" => 'app.api_user_provider'*/
                            /*'json_login' => [
                                'check_path' => '/api/login_check'
                            ]*/
                
                        
]     
        
                
                
                    ],
                    
array_slice($extensionConfig['firewalls'], $offsetnulltrue)
                );
                
                break;
            }
        }

        return 
$extensionConfigs;
    }

Der custom authenticator arbeitet wie er soll und auch die api firewall sichert gegen unbefugten Zugriffs ab.

Hat sich damit schonmal jemand auseinander gesetzt?