Netlify Build plugin identity-sso - Protect a site with SSO via identity.
The recommended way to install this right now is using a git npm dependency:
package.json
{
  // ...
  "dependencies": {
    "netlify-plugin-identity-sso": "netlify/netlify-plugin-identity-sso#v0.1.0"
  }
}netlify.toml
[[plugins]]
package = "netlify-plugin-identity-sso"- 
Go to
Settings -> Identityon your site and clickEnable Identity - 
Add a third-party auth provider, e.g. Google
 - 
Setup the identity webhook:
- URL: 
https://<site-name>.netlify.app/.netlify/functions/sso-auth - Secret: Generate a long random string
 - Events: Tick all boxes
 
 - URL: 
 - 
Set the webhook secret as a build environment variable
WEBHOOK_SECRETfor use in the function 
- Do not use a cached directory for publishing. For some reason this breaks
writing of a custom 
netlify.tomlas part of the build. - This is hardcoded to allow any user with a 
@netlify.comemail address.