netlify / gotrue

An SWT based API for managing users and issuing SWT tokens.
https://www.gotrueapi.org
MIT License
3.88k stars 288 forks source link

Implement SAML 2 external provider #181

Closed mraerino closed 6 years ago

mraerino commented 6 years ago

- Summary

These changes will enable GoTrue to perform SSO with any SAML 2.0 compliant auth provider.

It is based on the mostly stable lib gosaml2

Changes:

Config for the provider at external.saml looks like :

{
    "enabled": true,
    "metadata_url": "<URL to IdP metadata>",
    "api_base": "<URL of GoTrue API root>",
    "name": "<override provider name in identity widget>",
    "signing_cert": "<PEM-encoded X509 cert for signing>",
    "signing_key": "<PEM-encoded private key for singing>"
}

There is a PR for the netlify-identity-widget to support this provider and allow provider names overrides: https://github.com/netlify/netlify-identity-widget/pull/150

Tested with:

- Test plan

My tests cover:

- Description for the changelog

Add support for external SAML 2 SSO provider

- A picture of a cute animal (not mandatory but encouraged)


Disclaimer: Netlify is paying me for this. This is based on previous negotiations with them.

vmorsell commented 6 years ago

Great work @mraerino! Any idea when it will be merged and implemented?

mraerino commented 6 years ago

@vmorsell I don't know. Someone from Netlify still needs to review this. They seem pretty busy with things these days.

If you want to use this feature in your own gotrue deployment you could just use my branch and build it yourself. Should be straight-forward, at least when using the Dockerfile.