Enabling an Identity Provider
The enable identity-provider
command configures your workspace to make use of one of the pre-built open source
identity provider adapters in the saas-rs-sdk crate (see the
src/authentication/handlers folder).
Run this command multiple times to enable all the IdPs you intend to support.
Add Google IdP support
To configure your workspace to support Google logins, perform:
$ saas-rs enable identity-provider Google
You will notice the following files have been changed in your workspace:
Cargo.toml
A closer examination of Cargo.toml
will show that the saas-rs-sdk
crate has had an authentication-google
feature
flag added:
[workspace.dependencies]
saas-rs-sdk = { version = "0.2.7", features = ["...", "authentication-google"] }
Perform make
and then stage and commit the generated files before you make any further changes:
$ make
cargo fmt --all
cargo build
Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.73s
$ git add -A
$ git commit -m "saas-rs enable identity-provider Google"
Show all IdPs
To see a list of all the currently supported identity providers, run the command with a help argument like this:
$ saas-rs enable identity-provider --help
Usage: saas-rs enable identity-provider <provider>
Arguments:
<provider> The identity provider [possible values: Amazon, Apple, DigitalOcean, Facebook, GitHub, GitLab, Google,
Instagram, Linode, Microsoft, Okta, Twitter]
Options:
-h, --help Print help