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?

Server Configuration

Configure OAuth at the server level

Widget Decorators

Protect specific widgets

OAuth Providers

Set up Auth0 or other providers

Examples

See real-world implementations

Need help? Check our GitHub repository or reach out to the community.