This version is in beta. Some features may change before release.

OAuth / social login

Social login and OAuth account connection for umbral, layered on umbral-auth. Sign in with Google or GitHub, with provider tokens encrypted at rest.

OAuth / social login

umbral-oauth adds social login ("Sign in with Google") and account connection ("Connect GitHub") on top of umbral-auth. A social identity is a SocialAccount row linked to an AuthUser by foreign key - an extension of the user, never a replacement for the username - and provider tokens are stored in Masked columns, encrypted at rest.

Code
rust
use umbral::prelude::*;
use umbral_oauth::OAuthPlugin;
 
// Reads oauth_redirect_base + per-provider credentials from Settings
// (UMBRAL_OAUTH_* env vars); an unconfigured provider is simply skipped.
App::builder()
.plugin(OAuthPlugin::from_settings(&settings).login_redirect("/dashboard"))
.build()?;
Info

This page is the plugin overview. For the full flow - provider environment variables, the login / connect / callback routes, linking several accounts to one user, and the templates - see the complete guide: OAuth / social login.

Install

Code
bash
cargo add umbral-oauth

See also

oauthsocial-logingooglegithubauthplugin