The NginxSso plugin for Grav adds the ability of Single Sign On by integrating with Nginx SSO.
About installation and configuration of nginx-sso, please refer to Nginx SSO.
Install the NginxSso plugin manually:
$ cd /yoursite/user/plugins
$ git clone https://github.com/elementdavv/grav-plugin-nginxsso.git nginxsso
Simply copy user/plugins/nginxsso/nginxsso.yaml
to user/config/plugins/nginxsso.yaml
and make your modifications.
How does Nginx SSO work
Nginx SSO is working at domain level. It runs in the same one nginx deployment with web applications.
Nginx SSO forces visitors to login and authenticate before allowing them to access a web application. Every request is checked to ensure that it is valid.
After authenticated, Nginx SSO sends the visitor's email to web applications.
The NginxSso plugin obtains the email from HTTP header, logins the user automatically in grav if not logined, and register the user if needed. If there is no email in HTTP header, the NginxSso does nothing. It does not interfere with Grav-builtin login plugin.