Auth & permissions
renox-oauth
Social login (Sign in with Google, GitHub, …) linked to the users of a Renox app.
From crates.io
Version 1.3.1
Updated Oct 25, 2026
102 downloads
Install
Run this in your project folder. cargo add renox-oauth
renox-oauth
Social login for Renox apps: "Continue with Google" and
"Continue with GitHub" on the login and register pages, linked to the app's users table
(Laravel's Socialite, with the routes and the account page done for you).
use renox::prelude::*;
use renox_oauth::OAuth;
App::new()
.module(Auth::new().account()) // the account page, where users link and unlink providers
.module(OAuth::new().google().github()) // GOOGLE_CLIENT_ID/_SECRET, GITHUB_CLIENT_ID/_SECRET
What it adds:
GET /auth/{provider}/redirectand/callback: the authorization code flow with PKCE (S256) and a single-usestatebound to the session;- at a first sign-in, a link to the account with the same verified address (never by an unverified one), or a new account without a password when registration is open; the second login step (two-factor authentication) still applies;
- a card on
/accountto link and unlink providers (never the last way to log in), and "confirm it's you" with a linked provider for users without a password; - the
oauth_accountstable (no tokens stored), and the eventsAccountLinked,AccountUnlinkedandLoggedInWith, recorded in the activity log when the app has theAuditmodule; - Google, Microsoft and GitHub; another provider is one impl of the
Providertrait; - company sign-in:
Microsoft::from_config().tenant(..)(work accounts of one tenant, never personal ones),Google::from_config().hosted_domain(..)(a Workspace domain, checked on the callback) andOAuth::allow_domains(&[..])(verified email domains, any provider); a refused account gets a message and anOAuthRefusedevent.
The guide is docs/oauth.md;
examples/bikeshop uses it (Google and GitHub, when their keys are set). Versioned with renox: use the same version for both.