NitroStack Logo
/python
/sdk
/auth
/overview

Authentication Overview

Python ships three Nest-style modules: API keys, JWT (HS256), and OAuth 2.1.

ModuleGuardTypical env
ApiKeyModule.for_root(...)ApiKeyGuardAPI_KEY
JWTModule.for_root(...)JwtGuardJWT_SECRET
OAuthModule.for_root(...)OAuthGuardJWKS / introspection + OAUTH_REQUIRED

Import the module on AppModule, then stack @use_guards(...) on tools.

Python
from nitrostack import module, ApiKeyModule, OAuthModule, JWTModule

@module(
    name="app",
    imports=[
        ApiKeyModule.for_root(),
        JWTModule.for_root(),
        OAuthModule.for_root(),
    ],
)
class AppModule:
    pass

context.auth is an AuthContext (subject, scopes, client_id, aud, claims) after a successful guard.

Agent skill: nitrostack-python-auth-security (OAuth-focused). JWT and API keys are covered in the pages below.

Next steps