Add frontend login support
Created by: schliesser
I would like to use this extension for backend and frontend logins with Azure AD. (The Azure AD Connection configuration is done in my project extension.) The purpose of this MR is to extend the login service also for the frontend.
First I extended the tx_oauth2_client_configs
database table by the field parenttable
to differentiate between frontend and backend users. The TCA is therefore also extended to fill this field automatically. (Maybe an upgrade wizard is needed to fill the field in existing projects?)
The field is also added to the fe_users TCA. To render the field for FE users I had to change the Oauth2ProvidersElement
table check.
With the ModifyLoginFormViewListener
the oauth2 providers are passed to the frontend login fluid template and the template is extended to render a button for each provider.
Now comes the tricky part
After enabling the LoginService
for the frontend it is now necessary to handle both login types. The BackendUserRepository
is now extending the new UserRepository
which allows to find frontend and backend users. The callbackUrl is also different for the frontend login plugin and therefore must be built in an other way.
The FrontendUserRepository
is just a wrapper class which is not in use currently.
I don't expect this to be merged as is
Feel free to contact me via Slack or Discord.