OIDC (JWKS bearer)¶
Requires the oidc extra. See the Auth guide.
rn_forge.django.auth.drf.oidc
¶
JWKS bearer authentication for externally issued tokens in DRF.
JWKSBearerAuthentication
¶
Bases: PrincipalBearerAuthentication
Authenticate a bearer token against a remote OIDC JWKS endpoint.
Set jwks_url, issuer and audience on a subclass. Authenticators
and key sets are cached per subclass and process.
Verification and the claims-to-principal mapping are
:class:rn_forge.auth.oidc.OidcAuthenticator's, so this stack accepts the
same tokens as a FastAPI service wired to the same IdP. Accounts are linked
as in :class:PrincipalBearerAuthentication, so set accounts and
contexts too.