Framework Integration Presets
Replace https://auth.example.com with your JoeAuth ISSUER_URL.
Auth.js / NextAuth v5
Section titled “Auth.js / NextAuth v5”export default { id: "joeauth", name: "JoeAuth", type: "oidc", issuer: "https://auth.example.com", clientId: process.env.JOEAUTH_CLIENT_ID, clientSecret: process.env.JOEAUTH_CLIENT_SECRET, authorization: { params: { scope: "openid profile email" } },};Hono / Edge (oauth4webapi)
Section titled “Hono / Edge (oauth4webapi)”import * as oauth from 'oauth4webapi';
const issuer = new URL('https://auth.example.com');const as = await oauth.discoveryRequest(issuer).then((r) => oauth.processDiscoveryResponse(issuer, r));const client = { client_id: 'YOUR_CLIENT_ID' };const clientAuth = oauth.ClientSecretPost('YOUR_CLIENT_SECRET');FastAPI (Authlib)
Section titled “FastAPI (Authlib)”from authlib.integrations.starlette_client import OAuth
oauth = OAuth()oauth.register( name="joeauth", server_metadata_url="https://auth.example.com/.well-known/openid-configuration", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", client_kwargs={"scope": "openid profile email", "code_challenge_method": "S256"},)Go (coreos/go-oidc)
Section titled “Go (coreos/go-oidc)”provider, err := oidc.NewProvider(ctx, "https://auth.example.com")oauth2Config := oauth2.Config{ ClientID: os.Getenv("JOEAUTH_CLIENT_ID"), ClientSecret: os.Getenv("JOEAUTH_CLIENT_SECRET"), RedirectURL: "https://app.example.com/callback", Endpoint: provider.Endpoint(), Scopes: []string{oidc.ScopeOpenID, "profile", "email"},}Public SPA / Mobile / CLI (PKCE S256)
Section titled “Public SPA / Mobile / CLI (PKCE S256)”- Create the app in
/developerwithclientType: "public"(noclient_secretis issued or required). - Redirect users to
https://auth.example.com/oauth/authorizewithcode_challengeandcode_challenge_method=S256. - Exchange the returned
codeviaPOST https://auth.example.com/api/oauth/tokenwithclient_id,code,redirect_uri, andcode_verifier. - For CLI / smart-TV / headless devices, use
POST https://auth.example.com/api/oauth/device_codeand direct users tohttps://auth.example.com/device.