Skip to main content

Overview

Comming soon.
You would be able to use this feature starting from Nov 10.

Using Authentication in Widgets

Access user information in your widgets:
from fastapps import BaseWidget, auth_required, UserContext

@auth_required(scopes=["user"])
class ProtectedWidget(BaseWidget):
    identifier = "protected"
    title = "Protected Widget"
    input_schema = ProtectedInput
    
    async def execute(self, input_data, context, user: UserContext):
        # Access authenticated user
        return {
            "user_id": user.subject,
            "email": user.claims.get('email'),
            "scopes": user.scopes
        }

Next Steps

Ready to add authentication to your widgets?
Need help? Check our GitHub repository or reach out to the community.