Framework examples¶
The authenticator is framework-agnostic. Each example follows the same pattern:
- Read the authorization value from the incoming request.
- Parse and verify launch parameters with
get_verified_launch_params(). - Treat
InvalidInitDataErrorandNoneresults as authentication failures. - Use the verified
vk_user_idin application-specific user lookup logic.
-
FastAPI
Dependency-based authentication for route handlers.
-
Django
Middleware-based authentication for Django views.
-
Django Ninja
HttpBearerintegration for Ninja API endpoints.