Hosted pages on your domain
Sign in, sign up, reset, invites, consent and an account page, with your branding, on microauth.dev or your own subdomain.
Authentication
MicroAuth hosts the sign in pages, the accounts and the OAuth server. Your apps use OAuth 2.1 and OpenID Connect, read roles and permissions, and never handle a password.
from fastapi import Depends, FastAPI
from microauth_fastapi import User, UserAuth
app = FastAPI()
auth = UserAuth(app) # adds /auth/login, /auth/callback and /auth/logout
@app.get("/dashboard")
async def dashboard(user: User = Depends(auth.login_required)):
return {"hello": user.name, "roles": sorted(user.roles)}
@app.post("/posts")
async def create_post(user: User = Depends(auth.require(permissions="posts:write"))):
...
from fastapi import Depends, FastAPI
from microauth_fastapi import TokenAuth, TokenClaims
app = FastAPI()
api = TokenAuth(app) # reads MICROAUTH_ISSUER and MICROAUTH_RESOURCE
@app.get("/posts")
async def posts(token: TokenClaims = Depends(api.require("posts:read"))):
return {"user": token.sub, "app": token.client_id}
from fastapi import Depends, FastAPI
from microauth_fastapi import TokenAuth, TokenClaims
app = FastAPI()
api = TokenAuth(app, api_keys=True) # also reads the API's server credentials
@app.post("/posts")
async def create_post(caller: TokenClaims = Depends(api.require("posts:write"))):
return {"author": caller.sub, "via": caller.via}
How it works
People sign in on pages MicroAuth hosts at your sign in address. Your apps get tokens through the standard code flow and check them locally.
A page that needs a signed in user sends the browser to your sign in service, with a one time PKCE challenge.
With a password, a passkey or a provider like Google. Someone already signed in to another of your apps skips this step.
MicroAuth sends the browser back with a short lived code, and your server exchanges it for tokens.
The SDK keeps it in an encrypted cookie and refreshes tokens, so new roles and suspensions reach your app.
Sign in, sign up, password resets, invites, passkeys and two step verification, with your logo and colors. They are live at yourapp.microauth.dev right away, and can move to a domain of yours like auth.example.com on plans that include one.
People also get an account page for their profile and photo, sessions, connected providers and the apps they allowed. Security emails go out under your app's name.
Every app uses the code flow with PKCE. Access tokens are short lived JWTs for one API, refresh tokens change on every use, and ID tokens tell your app who signed in and how.
Web apps, single page apps and native apps all work, with any OpenID Connect library in any language. With FastAPI, the SDK does it in a few lines.
{
"issuer": "https://auth.example.com",
"authorization_endpoint": "https://auth.example.com/oauth/authorize",
"token_endpoint": "https://auth.example.com/oauth/token",
"jwks_uri": "https://auth.example.com/oauth/jwks",
"code_challenge_methods_supported": ["S256"],
"scopes_supported": ["openid", "profile", "email",
"offline_access", "roles", "posts:read", "posts:write"]
}
Define permissions such as posts:write and group them into roles. Your app reads them from the session, and they become the OAuth scopes of your APIs and MCP servers.
The users page lets you search, change roles, see sessions and connected apps, suspend someone, sign them out everywhere, send a password reset or invite new people.
Features
Sign in, sign up, reset, invites, consent and an account page, with your branding, on microauth.dev or your own subdomain.
Discovery, PKCE for every app, pushed authorization requests, rotating refresh tokens, userinfo, revocation, introspection and sign out.
Permissions you name, roles that bundle them, and default roles for new users. Changes reach your app within one token lifetime.
Search users, change roles, suspend, sign out everywhere, send a reset, remove two step verification, delete or invite.
Google, GitHub, any OpenID Connect provider or a generic OAuth 2.0 one, with your own client credentials and safe account linking.
Passkeys, authenticator apps and recovery codes on your sign in pages, with security emails under your app's name.
People create keys for scripts and CI with the permissions they choose. Your API checks them with TokenAuth or standard token introspection.
The same service lets AI clients use your MCP servers for a person, with consent. See AI access.
UserAuth for web apps and TokenAuth for APIs, in one package. See the SDK.
Questions
No. Sign in is standard OpenID Connect, so any OpenID Connect library works, in any language. Access tokens are JWTs your API can check with the published signing keys, and API keys can be checked with standard token introspection. FastAPI gets an SDK that does all of it in a few lines.
The sign in pages keep their own session on your sign in domain, which gives single sign on across your apps. Each app runs the code flow on its server, and the FastAPI SDK keeps its session in an encrypted, HttpOnly cookie. No token is ever handed to browser JavaScript.
Yes, with your own client credentials from Google or GitHub. You can also add any OpenID Connect provider, or a generic OAuth 2.0 one. The pricing page shows which plans include each.
Roles and permissions are read again on every token refresh. Access tokens last 10 minutes by default, so a role you remove, or a suspension, reaches your app within one access token lifetime.
Create a sign in service in the dashboard, register your app and add a few lines with the FastAPI SDK. Your sign in pages are live right away.