Umbral
Back to plugin directory
UO

Umbral OAuth

Official Featured by Umbral contributors

Google/GitHub login, PKCE, state checks, account linking

official beta

About

"Sign in with Google" removes the single biggest signup drop-off: the password. Umbral OAuth drops social login in without the callback-URL-and-token-exchange boilerplate — register a provider, and the login route, the redirect dance, and account linking are handled. Credentials come from the environment, so a provider with no keys simply isn't registered: you can leave the wiring in place with nothing configured and it stays inert until you add the keys.

Install

cargo add umbral-oauth   # builds on umbral-auth

Wire it up

Read the keys from the environment and register each provider only when both halves are present.

use umbral::prelude::*;
use umbral_oauth::OAuthPlugin;
use umbral_oauth::providers::{GoogleProvider, GitHubProvider};

let app = App::builder()
    .database("default", pool)
    .plugin(
        OAuthPlugin::new("https://acme.dev")   // public origin for callbacks
            .login_redirect("/dashboard")
            .provider(GoogleProvider::new(google_id, google_secret))
            .provider(GitHubProvider::new(github_id, github_secret)),
    )
    .build()?;

Target: let an existing user connect GitHub

Beyond first-time login, a signed-in user can link a provider to their existing account, so they can use either path next time.

What you get

  • Google and GitHub providers, callback flow handled
  • Connect a provider to an already-signed-in account
  • Credentials read from env — unconfigured providers just don't register
  • Safe to leave wired with nothing set; inert until keys appear
  • Builds on umbral-auth's user model and session

Usage

Give `OAuthPlugin::new(base)` your public origin (for callback URLs), then `.provider(...)` each provider. Read client id/secret from the environment and register a provider only when both are present — an unconfigured provider is simply skipped.

plugin setup
cargo add umbral-oauth

Feature tracker

Per-feature shipping status, recorded in the directory.

6 of 6 shipped
Google provider shipped Beta

Ready-made Google OAuth provider integration.

GitHub provider shipped Beta

Ready-made GitHub OAuth provider integration.

PKCE and state checks shipped Beta

Verifier/challenge generation and state CSRF protection.

Account linking shipped Beta

Connect a provider to an already signed-in user.

Return URL allow-list shipped Beta

Constrain post-login redirects to trusted prefixes.

Provider discovery shipped Beta

Expose registered providers for login UI rendering.

Compatibility

Declared support per Umbral version and database backend.

No compatibility rows declared yet.

Community notes

0 notes in the discussion thread.

No notes yet. Be the first to share how this plugin works for you.

Reported issues

Bugs and abuse reports filed against this plugin.

Report an issue

No open issues

No issues have been reported against this plugin. Track upstream bugs on the maintainer's tracker, or report a directory problem to the Umbral team.