Add basic documentation

master
Lars Vierbergen 7 years ago
parent d2ec4db516
commit 861518efdd
  1. 19
      readme.md

@ -1,4 +1,21 @@
# Authserver: External account plugin
This [Authserver](https://github.com/vierbergenlars/authserver) plugin that provides common infrastructure
for plugins adding support for authentication with external accounts.
for plugins adding support for authentication with external accounts. It does not provide any external accounts by itself, but is a dependency of other plugins that do provide external accounts.
## Developing an external authentication plugin
An external authentication plugin requires at least two parts of configuration:
Symfony authentication configuration and an Authserver ExternalAccountProviderInterface.
### Symfony authentication
Your external authentication plugin should add an extra way of authenticating to the `public` firewall.
Because the firewall configuration can not be modified using the standard symfony `PrependExtensionInterface::prepend()` method, refer to the "Plugin events" section of the Authserver plugin documentation on how to modify configuration before it is loaded.
Typically, only very basic configuration is needed during the `PluginEvents::CONTAINER_CONFIG`, the rest of the configuration can be handled in the Extension,
where you can access the container configuration.
### Authserver ExternalAccountProviderInterface
Implementing the `ExternalAccountProviderInterface` and exposing it as a service with tag `vierbergenlars.external_account.provider` registers the External Account Provider with Authserver and provides an easy interface to configure login buttons, and optionally connect and disconnect buttons for users to attach and detach their existing account from an external account.